Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Does order of a PK columns in a SELECT matter in the speed of the query?
Say I have a table as Tab1 with columns col1, col2, col3, col4, col5, ...
and it has a compound PK as PK_tab1 (col1, col2,col3). Now I run the
following SELECTs:
1- SELECT * FROM Tab1 WHERE col1='X' AND col2=10 and col3='Y';
2- SELECT * FROM Tab1 WHERE col2=10 AND col3='Y' and col1='X';
.or any possible combination...
.
Which one will execute faster? or the order they appear in the WHERE clause
doesn't matter and optimizer will take care of it?
Platform: Oracle 8.04 on NT4.0
Any prompt input will be appreciated! Thanks in ad!
Adam tadj
adamt_at_hsltd.com
Opinions expressed or questions asked are mine not of my employer.
Received on Fri May 28 1999 - 10:40:30 CDT
![]() |
![]() |