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 -> query slower using order by asc (default index order) than oder by desc

query slower using order by asc (default index order) than oder by desc

From: VIC <victorcy_at_gmail.com>
Date: 16 Feb 2006 00:56:47 -0800
Message-ID: <1140080207.714101.5710@g44g2000cwa.googlegroups.com>


Scenario:
Got a big normal(non-partition) table (about 5 million rows), only index is the default ascending primary key index on primary key column (id)

Query 1.
select * from contentowner2.system_log order by id asc

Query 2.
select * from contentowner2.system_log order by id desc

Query 1 will take take more than 10 minutes to run Query 2 will take no more than a second to return result.

Could anyone explain to me why query order by asc is so slow compared with query order by desc

Thanks,
Vic Received on Thu Feb 16 2006 - 02:56:47 CST

Original text of this message

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