Re: Need help on limiting # of rows returned...

From: Kevin Neel <k-neel_at_nwu.edu>
Date: 11 Feb 1994 17:12:03 GMT
Message-ID: <2jge93$9b4_at_anaxagoras.ils.nwu.edu>


In article <1994Feb11.004859.25154_at_mnemosyne.cs.du.edu> bob alimi, balimi_at_nyx.cs.du.edu writes:
>I don't want to return all 70,000 and then access via 'fetch next 50',
 'cause
>the initial query takes so long. I can only think to re-create a table
 of
>emps sorted on empno, and let this non-arbritrary ordering of rows return
>the empno's in order. Is there another way?

If you have an index on empno, then the initial query shouldn't take too long -- it should bump its way through the index at fetch time. So it shouldn't actually spend time on the rest of the rows. I'm not sure if a concatenated index of COMM,EMPNO will work (if so, it would be even faster); generally nulls aren't indexed, but I'm not sure if that is true for concatenated indices in which one of the column values is null. Received on Fri Feb 11 1994 - 18:12:03 CET

Original text of this message