Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to speed up query
Message
General information
Forum:
Oracle
Category:
Other
Title:
How to speed up query
Miscellaneous
Thread ID:
00437367
Message ID:
00437367
Views:
61
Hi,

I try to run the following query on oracle: (all the columns used in WHERE clause are already indexed)
SELECT Tab1.*, Tab2.*, Tab3.*, Tab4.*, Tab5.* FROM tab1, tab2, tab3, tab4, tab5 WHERE (tab1.column1=tab5.column1) AND (tab1.column2=tab2.column2) AND (tab2.column3=tab4.column3) AND (tab2.column4=tab3.column4)
AND tab1.column5=to_date('1900-01-01','YYYY-MM-DD')
AND tab2.column6='03' AND tab2.column7='AC';

It takes 20 minutes. But if I run the following:

SELECT Tab1.*, Tab2.*, Tab3.*, Tab4.*, Tab5.* FROM tab1, tab2, tab3, tab4, tab5 WHERE (tab1.column1=tab5.column1) AND (tab1.column2=tab2.column2) AND (tab2.column3=tab4.column3) AND (tab2.column4=tab3.column4)
AND tab1.column5=to_date('1900-01-01','YYYY-MM-DD');

It takes 15 seconds. And also the following take the same 15 seconds:

SELECT Tab1.*, Tab2.*, Tab3.*, Tab4.*, Tab5.* FROM tab1, tab2, tab3, tab4, tab5 WHERE (tab1.column1=tab5.column1) AND (tab1.column2=tab2.column2) AND (tab2.column3=tab4.column3) AND (tab2.column4=tab3.column4)
AND tab2.column6='03' AND tab2.column7='AC';

Is sth wrong with the first query?

Thanks a lot.
Next
Reply
Map
View

Click here to load this message in the networking platform