What is index-database?
A data structure that improves the speed of data retrieval operations on a database table.
A database index works much like the index in the back of a book. Instead of scanning the entire table (a full table scan), the database uses the index to find the location of the data it needs instantly. This significantly reduces the disk I/O required for queries, at the cost of some additional storage and slower write operations.
graph LR
Center["What is index-database?"]:::main
Rel_hash_table["hash-table"]:::related -.-> Center
click Rel_hash_table "/terms/hash-table"
Rel_relational_database["relational-database"]:::related -.-> Center
click Rel_relational_database "/terms/relational-database"
Rel_encryption_at_rest["encryption-at-rest"]:::related -.-> Center
click Rel_encryption_at_rest "/terms/encryption-at-rest"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 Wissenstest
🧒 Erkläre es wie einem 5-Jährigen
An index is like the 'Index' at the back of a history book. If you want to find 'Napoleon', you don't read the whole book from page one. You go to the index, find 'Napoleon', see it says 'Page 402', and flip right there. It saves a lot of time!
🤓 Expert Deep Dive
Indices are usually implemented using B-Trees or Hash Tables. While they speed up SELECT queries, they slow down INSERT, UPDATE, and DELETE operations because the index itself must be updated every time the data changes. Choosing which columns to index is a critical part of database performance tuning.