Skip to Main Content

SQL & PL/SQL

Get z record fast (from x to y records)

425035Sep 13 2007 — edited Sep 14 2007
Hello gurus,

I have table a containing around 7 milion records and trying to retrieve z record.
I have tried to this script

SELECT id, name
FROM
(
SELECT ROWNUM rn, id, name
FROM table_a
ORDER BY name
)
WHERE rn BETWEEN 5 to 10;

Already use index for the table and it retrieve fast if I start from rownum = 1.
And have tried using hints FIRST_ROWS but doesnt do any good.
Is there any way to make it faster?

Thank you so much
henry
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2007
Added on Sep 13 2007
9 comments
2,476 views