What is a Database Index?
The concept of database indexes explained in under 100 words. #Under100
![What is a Database Index?](/content/images/size/w2000/2021/08/books-283251_1920.jpg)
![](https://nolongerset.com/content/images/2021/08/image-49.png)
An index is an internal copy of a table sorted by the index field(s). The only columns are the index field(s) and primary key.
![](https://nolongerset.com/content/images/2021/08/image-50.png)
The database uses the index to look up the primary key. It uses the primary key to look up the row in the original table.
Advantages
- Faster lookups
Disadvantages
Each index is an extra table for the database to maintain, which means:
- Extra storage space
- Slower INSERT/UPDATE/DELETE
Bottom Line
It's important to understand the tradeoffs when adding (or omitting) indexes.
Image by kropekk_pl from Pixabay