Index are an additional data structure that derived from the primary data table, to speed up look up.

The general idea of indexes is to keep some additional metadata on the side to help locate the data you want.

Many database allow us to create or remove indexes with out affecting data. It only aff ect the performance of queries.

The trade off of using indexes is: well-chosen index speed up queries but every index slow down write!

That's why database don't index everything.

There are different way to implement database index, for example §202109061404 Hashmap-based Index or §202109061631 LSM Tree Index,...


Source: Designing Data-Intensive applications, Chapter 3, Pg. 71
#database