Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Where clause sequence to follow Index column sequence?

user10416432Jun 16 2016 — edited Jun 17 2016

Give an index on a table A (col1, col2, col3, col4)

I have been told by my senior staff analyst to code the Where clause as follows:

Where col1 = :val1

and     col2 = :val2

and    col3 = :val3

and    col4 = :val4.

The query is executed thousands of times every day for a few minutes (whole process) interval by 30minutes.

The reason given is that it saves DBMS from reconstructing th query to suit the index at each execution?

Question is if my original query were :

Where col4 = :val4.

and    col1 = :val1

and    col3 = :val3

and     col2 = :val2

would my performance be degraded?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2016
Added on Jun 16 2016
7 comments
2,116 views