Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I view a block of n rows anywhere in the table?
I could se why it get slower the higher the value, if you want to see
between 9500 and 10000 records, it has to fetch 10000 records before it
narrows it down.
Unfortunately, i'm not aware of a method apart from your one which would be quicker ;-(
M
Steven Franklin wrote in message <37568A1A.A52F62C6_at_wcom.com>...
>I'm trying to look at block of n rows anywhere within the table. i.e.
>I don't want to format 250K rows for display in HTML. Rather, I'd like
>to be able to format and display a block of say 10 rows at a time and
>skip around through the table.
>
>This method seems to work, but it gets very slow when trying to
>look at rows further into the table.
>
>SELECT driver.key1,
> driver.key2,
> col1,
> col2
>FROM tbl,
> (SELECT /*+ INDEX(tbl idx_key2) */
> rownum rn,
> key1,
> key2
> FROM tbl
> WHERE rownum <= UpperRow) driver
>WHERE (tbl.key1=driver.key1) AND
> (tbl.key2=driver.key2) AND
> (rn >= LowerRow)
>
>where idx_key2 is an index with the desired sort order. And UpperRow and
>LowerRow define the boundries of the block want to look see.
>
Received on Thu Jun 03 1999 - 10:28:27 CDT