Database / LanceDB Interview questions
What is ANN (Approximate Nearest Neighbor) search?
Approximate Nearest Neighbor search is a technique for finding vectors close to a query vector without exhaustively comparing the query against every single vector in the dataset, trading a small amount of recall accuracy for a large gain in search speed.
An exact nearest-neighbor search (sometimes called a "brute-force" or "flat" search) compares the query vector against every stored vector and is guaranteed correct, but its cost scales linearly with dataset size, which becomes impractical once a table holds millions or billions of vectors.
ANN algorithms instead build an index structure at write time (LanceDB supports several, including IVF-PQ and HNSW) that narrows the search to a much smaller candidate set of likely-close vectors at query time, returning results that are usually correct but not mathematically guaranteed to be the exact top matches — an acceptable trade-off for most real-world similarity search applications, where "close enough" candidates are what actually matters.
More Related questions...