All terms
Glossary
Database index
An additional structure that lets the database find rows without reading the whole table.
A fitting index turns a query from seconds into milliseconds. It costs storage and slows writes, because it has to be maintained.
Which index fits follows from the actual queries, not from the data model.
How you notice it
- Individual queries take seconds.
- The database is at its limit under load, the application is not.
- There are tables with millions of rows and few indexes.
Frequently asked
How do I find the missing index?
From the execution plan of the slowest queries. Every database shows whether it scans a table or uses an index. In grown systems that list usually yields two or three candidates worth more than a week of code optimization.
