Home » RDBMS Server » Performance Tuning » Index skip scan (oracle,11.2.0.2,aix6.1)
|
|
|
|
|
|
Re: Index skip scan [message #555172 is a reply to message #554936] |
Mon, 21 May 2012 22:24   |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Here are some notes on Index Skip Scan that may help.
Generally speaking, a Skip Scan is going to be slower than a Range-Scan or Unique-Scan ON THE SAME COLUMNS. How much slower will depend on the number of distinct values of the 1st column in the index. Read the link for more information.
eg.
select * from emp where col1=:c1 and col2=:c2;
A range-scan on index (COL2) will be better than a skip-scan on index (COL3, COL2). However a range/unique scan on index (COL1, COL2) would be faster still.
The only exceptions to this rule that I can think of are:
- If the index on (COL2) was highly fragmented, it could under-perform.
- If the index on (COL2) contained other columns not referenced by the query [eg. (COL2, COL4, COL5, COL6, COL7)] then it could increase IO to the point that it was slower than a Skip-Scan on an index without the junk columns, such as (COL3, COL2)
Ross Leishman
|
|
|
|
Re: Index skip scan [message #555273 is a reply to message #555228] |
Tue, 22 May 2012 16:30  |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
If you have an index I1 on (C1, C2) in that order, then
- C2 = <value> could give a SKIP SCAN on I1
- C1 = <value> should give a RANGE SCAN on I1
- C1 = <value> AND C2 = <value> should also give a RANGE SCAN on I1 or - if the index is unique - a UNIQUE SCAN
The 3rd option would certainly be fastest
Ross Leishman
|
|
|
Goto Forum:
Current Time: Tue Apr 29 05:52:46 CDT 2025
|