Database indexes for database speed & optimization
Database Index Tips
* Put the most unique data element first in the index, the element that has the biggest veriety of values. The index will find the correct page faster.
* Keep indexes small. It’s better to have an index on just zip code or postal code, rather than postal code & country. The smaller the index, the better the response time.
* For high frequency functions (thousands of times per day) it can be wise to have a very large index, so the system does not even need the table for the read function.
* For small tables an index is disadvantageous. For any function the system would be better off by scanning the whole table. An index would only slow down.
* An index slows down additions, modifications and deletes. It’s not just the table that needs an update, but the index as well. So, preferably, add an index for values that are often used for a search, but that do not change much. An index on bank account number is better than one on balance.