skip to main content
Using indexes : Improving row selection performance
  

Try DataDirect Drivers Now

Improving row selection performance

For indexes to improve the performance of selections, the index expression must match the selection condition exactly. For example, if you have created an index whose expression is last_name, the following Select statement uses the index:
SELECT * FROM emp WHERE last_name = 'Smith'
This Select statement, however, does not use the index:
SELECT * FROM emp WHERE UPPER(last_name) = 'SMITH'
The second statement does not use the index because the Where clause contains UPPER(last_name), which does not match the index expression last_name. If you plan to use the UPPER function in all your Select statements and your database supports indexes on expressions, then you should define an index using the expression UPPER(last_name).