Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Query
Select * from orders where load_id = 174659 order by order_id ;
select * from orders where load_id = 174659 order by order_dt;
I have similar queries. This table has about 19mil rows. Statistics are current. Order_id is the primary key. The index exists on load_id. The first one does a index full scan on order_id and second one does a index range scan on load_id. There is no index on order_dt. If needed i can post the explain plans and stats details from user_tables/user_indexes. I am wondering why the index on load_id is not chosen in the first SQL statement. Received on Wed Jan 17 2007 - 21:09:50 CST