Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> query slower using order by asc (default index order) than oder by desc
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