RBO secret #4

If you access the multi-column index using the = operator, then it takes precedence over other operators, such as LIKE and BETWEEN.

The use of two operators = gives precedence over the use of two operators = and LIKE one.

For example:

SELECT col1, ...
FROM emp
Emp_name WHERE LIKE 'Gurry'
AND emp_no = 127
AND dept_no = 12
AND emp_category = 'CLERK'
AND emp_class = 'Cl';
Indexl (emp_category, emp_class, emp_name) Index2 (emp_no, dept_no)

In the example above, will be used only Index2, although reference is made to three columns Indexl compared with two, it has Index2.

No comments: