Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to use ROWNUM and ORDER BY?

How to use ROWNUM and ORDER BY?

From: Shinu Gupta <shinu_at_openix.com>
Date: 1997/02/11
Message-ID: <5dqf1l$54q$1@spasmolytic.openix.com>#1/1

Hi:

I am working on a web site using Oracle 7.3.2 on Sun Solaris. The database has over 500,000 products and after search I display only 25 at a time. The search is very very slow and so I started using :

select * from table where [condition] and rownum < 25 order by columnname;

This speeded up the search - but messed the the results. How can I use ROWNUM (to speed the search) and still get the correct order. Someone said that I should use a view with order by inside it - but then it again makes my search very slow - as it first orders all the rows - say 5,000 before applying the rownum condition.

Thanks
Shinu
 --


                        Shinu Gupta (shinu_at_webvalue.com)

       http://www.webvalue.com                     http://www.a1books.com
      --------------------------------------------------------------------     
Received on Tue Feb 11 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US