SELECT col1, ...
FROM emp
WHERE emp_name = 'Gurry'
AND emp_no = 127
AND dept_no = 12;
Indexl (dept_no)
Index2 (emp_no, emp_name)
The SELECT statement through all three columns with an index. Many people think that in order to return the requested data, Oracle merges the two indexes, and thus indirectly all three columns. In reality, however, is only used two-column index, and a single-column index remains untapped. Oracle Single Column scaliĆby two indexes, but not merge with another multi-column index.
Table 1. Conditions scheduling rule-based optimizer
Rank | Condition
- ROWID '= constant
- Merge two clusters (cluster join) with a unique key or key = constant
- Key hashed cluster (hash cluster) with a unique key or key = constant
- whole unique concatenated index = constant
- column with a unique index = constant
- whole cluster key = corresponding cluster key in another table in the same cluster
- Key cluster hashed non-unique = constant
- whole cluster key = constant
- All non-unique concatenated index = constant
- Merge non-unique index
- The whole concatenated index = lower limit
- Most of the leading columns of a unique index = constant
- Indexed column between the bottom and the top value or - indexed column LIKE "ABC%" (limited range) - Indexed
- non-unique column between the bottom and the top value or indexed column LIKE "ABC%" (limited range)
- unique indexed column or a fixed value (unlimited range)
- non-unique indexed column or a fixed value (unlimited range)
- Equality non-indexed columns = column or the value of the constant (join by sorting and merging)
- MIN MAX or individual columns in indexes
- ORDER BY the index
- Inspection of the entire table
ROWID - row identifier, identifies each row by its location or address
In view of the above comments - be aware of one thing. If the index is a single-column index or a unique primary key, makes it. One column that the index takes precedence over multicolumn index. Just compare the rank of 4th with the rank of 9th of Table 1
NOTE
For Oracle8i introduced a new indication index_ JOIN, which allows you to merge multi-column indexes.
No comments:
Post a Comment