Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Does order of a PK columns in a SELECT matter in the speed of the query?

Does order of a PK columns in a SELECT matter in the speed of the query?

From: Adam Tadjkarimi <adamt_at_hsltd.com>
Date: Fri, 28 May 1999 10:40:30 -0500
Message-ID: <7imdh4$qvu$1@newsin-1.starnet.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US