# Database Indexing Strategies

## Metadata
- Author: [[ByteByteGo]]
- Full Title: Database Indexing Strategies
- Category: #articles
- Summary: Database indexes help speed up data searches by organizing information efficiently, often using structures like B+ Trees. Different types of indexes, such as primary, secondary, covering, and bitmap indexes, serve various purposes to improve query performance. Choosing the right index is important to balance fast data retrieval with the costs of updating and storage.
- URL: https://blog.bytebytego.com/p/database-indexing-strategies
## Highlights
- The structure of a database index includes an ordered list of values, with each value connected to pointers leading to data pages where these values reside. Index pages hold this organized structure which provides a more efficient way to locate specific information. ([View Highlight](https://read.readwise.io/read/01kzsd4qcebxwpx0cvdbyfa14x))
- Indexes are typically stored on disk. They are associated with a table to speed up data retrieval. Keys made from one or more columns in the table make up the index, which, for most relational databases, are stored in a B+ tree structure. This structure allows the database to locate associated rows efficiently. ([View Highlight](https://read.readwise.io/read/01kzsd4v8jd3m5s2qby6d4efqy))
- In its simplest form, an index is a sorted table that allows for searches to be conducted in O(Log N) time complexity using binary search on a sorted data structure. ([View Highlight](https://read.readwise.io/read/01kzsd5hk9xp36v1mc4r4pggng))
- Various data structures, such as B-Trees, Bitmaps, or Hash Maps, can be used to implement indexes. Though all these structures offer efficient data access, their implementation details differ.
For relational databases, indexes are often implemented using a B+ Tree, which is a variant of B-Tree. ([View Highlight](https://read.readwise.io/read/01kzsd5v9b7dr1xypnv81r1h70))