You are administering database that supports an OLTP workloads. Most of the queries use an
index range scan or index unique scan as access methods.
Which three scenarios can prevent the index access being used by the queries?
A.
When highly selective filters is applied on an indexed column of a table with sparsely populated
blocks.
B.
When the rows are filtered with an IS NULL operator on the column with a unique key defined
C.
When the histogram statistics are not collected for the columns used in where clause.
D.
When a highly selective filter is applied on the indexed column and the index has very low value
for clustering factor.
E.
When the statistics for the table are not current.
Explanation:
D: The clustering_factor measures how synchronized an index is with the data in a
table. A table with a high clustering factor is out-of-sequence with the rows and large index range
scans will consume lots of I/O. Conversely, an index with a low clustering_factor is closely aligned
with the table and related rows reside together of each data block, making indexes very desirable
for optimal access.
Note:
* Oracle SQL not using an index is a common complaint, and it’s often because the optimizerthinks that a full-scan is cheaper than index access. Oracle not using an index can be due to:
* (E) Bad/incomplete statistics – Make sure to re-analyze the table and index with dbms_stats to
ensure that the optimizer has good metadata.
* Wrong optimizer_mode – The first_rows optimizer mode is to minimize response time, and it is
more likely to use an index than the default all_rows mode.
* Bugs – See these important notes on optimizer changes in 10g that cause Oracle not to use an
index.
* Cost adjustment – In some cases, the optimizer will still not use an index, and you must
decrease optimizer_index_cost_adj.
THE ANSWER IS A,B,E
For me answer is B,C,E
I agree with sasa, A,B,E
C can’t be correct, as Histogram would be useful only when data is screwed up on index column and not evenly distributed in tables which is not mentioned on Question/answer. and since they mention unique scan , which means that most of the data is evenly distributed.
D would have been correct if index has high clustering factor.
my opinion: B, C, E
E* – it is obvious, no statistics – optimizer can not use the index – good candidate for full table scan
D – high selective filter and low clustering factor indicating good index and table correlation – perfect example for use of the index
C* – collecting histograms statistics can result in full table scan in some cases. Without histograms the optimizer will probably choose index over full table scan. But in case when one value holds 99% of data in a column (oracle doesn’t know that without a histogram) index will result in a very bad execution plan.
B* – unique key defined so probably B-tree index is used. B-tree indexes does not contain NULL values so full table scan must be used
A – highly selective filter and sparsely populated blocks in a table – good for index use, bad for full table scan. In sparsely populated table and full table scan oracle has to read multiple blocks – more than it could read in case of densely opulated blocks. In this case use of index will prevent from performing unneccessary I/O reads.
BCE