Database index
Inspired by DB Indexing in System Design Interviews - B-tree, Geospatial, Inverted Index, and more!
Removes the need for a slow sequential scan.
B-tree is the most popular, allows range queries with almost O(1).
Hash index (key mapping) is definitely fast and O(1) but can't do range queries. Good for caches.
Inverted indexes are great for full text search.