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

Home -> Community -> Usenet -> c.d.o.server -> How to optimize large ORDER BY queries

How to optimize large ORDER BY queries

From: Barry Frank <barry_frank_at_yahoo.com>
Date: 20 Jul 2001 12:58:27 -0700
Message-ID: <9b0e6900.0107201158.38743820@posting.google.com>

Can anyone offer a technique for the following scenario:

I need to set up a "ticket" table that will serve as a queue. The query that gets tickets off the table needs to ORDER the records so that the tickets are processed FIFO. It is a composite ORDER BY clause, using CREATED_DAY, PRIORITY, and TICKET_ID.

At times, records will backlog (to the tune of hundreds of thousands). When this happens, the dequeueing query takes too long, plus processor usage maxes out at 100%.

My question is: can I somehow set it up so that the table's records are physically sorted, so I can simply use ROWNUM = 1 to pull the record I want? Or is there any technique I can use that specifically optimizes ordering? I need to use the index that affects the filter; i.e. the WHERE clause (on different fields). So an index on the ORDER BY fields is not helpful.

Any help is appreciated.

Received on Fri Jul 20 2001 - 14:58:27 CDT

Original text of this message

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