Improving row selection performance
- Last Updated: August 19, 2019
- 1 minute read
- DataDirect Connectors
- ODBC
- Aha! 8.0
- Amazon Redshift 8.0
- Apache Cassandra 8.0
- Apache Hive 8.0
- Apache Spark SQL 8.0
- Autonomous Rest Connector 8.0
- Cloudera Impala 7.1
- dBase 7.1
- + 24
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).