Indexing & Fuzzy Name Matching · TL;DR
1 min readRapid overview
TL;DR
Every index is a data structure that answers one shape of question quickly, and the whole subject is the consequence of that sentence. A B-tree answers "which rows have exactly this value, or a value in this range, or a value starting with this prefix" — and it cannot answer "which rows look roughly like this", at any speed, ever. Fuzzy name matching exists entirely because of that one limitation. The correct architecture is always two stages: retrieve a deliberately wide set of candidates cheaply, then score them precisely and decide. The two most expensive mistakes in this area are collapsing those two stages into one, and putting a fixed number on the width of the first stage while the data grows underneath it.