17. Improving Database and Query Performance : Design Issues and Performance : Key Design and Performance : Multi-Column Keys and Performance
 
Share this page                  
Multi-Column Keys and Performance
Multi-column keys have special issues. If used improperly in your query, the key cannot be used and the search does a full-table scan.
Keep the following in mind:
Use the most unique and frequently used columns for the left member of a multi-column key.
Searches on B-tree and ISAM tables must use at least the leftmost part of a multi-column key in a query, or a full-table scan can result.
Searches on hash tables must use an exact match for the entire key in the query, or a full-table scan can result.
Optimizer statistics are approximated by adding the statistics of the columns making up a multi-column key.