Home » RDBMS Server » Server Administration » Indexes
Indexes [message #372544] Wed, 21 February 2001 09:04 Go to next message
meena
Messages: 36
Registered: December 2000
Member
Suppose I have a table with columns Col1, Col2, Col3. I create a composite index on (Col1, Col2). And the following query is performed,

SELECT Col3 FROM table_name WHERE Col1 = value and Col2 = value;

How will this query be executed?

(1) Will Oracle find the the value of Col1 and then check all the rows corresponding to that Col1 for the value of Col2 specified?

OR

(2) Will it directly go to the row corresponding to the specified values of Col1 and Col2?

Thanks,
-Meena
Re: Indexes - Answer 2 [message #372546 is a reply to message #372544] Wed, 21 February 2001 09:43 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
Answer 2
Re: Indexes [message #372565 is a reply to message #372544] Fri, 23 February 2001 01:38 Go to previous message
Balamurugan
Messages: 4
Registered: February 2001
Junior Member
Hai,

With reference to your doubt. You have
created the composite index for col1 and col2.
It will retreive the col3 directly using col1 and col2.

With regards,
Balu
Previous Topic: matching problem
Next Topic: How to find n max salaries from each department
Goto Forum:
  


Current Time: Sat May 18 04:46:46 CDT 2024