Company
Date Published
March 10, 2022
Author
Ben Darnell
Word count
1910
Language
English
Hacker News points
12

Summary

The article discusses three basic rules for choosing indexes in a database: usefulness, clustering, and scattering. Usefulness refers to the ability of an index to speed up query execution or enforce constraints without slowing down writes. Clustering involves keeping records likely to be accessed together near each other, while scattering ensures that records unlikely to be accessed together are far apart. The article also explores options for selecting unique IDs, including sequences, timestamps, and randomness, as well as hybrid approaches and interleaving techniques. It emphasizes the importance of considering these factors in a distributed database environment like CockroachDB.