The text explores a novel approach to building vector indices in ClickHouse, a columnar database management system, using SQL. The approach is based on Local Sensitive Hashing (LSH) and random projections, which allows for efficient estimation of distances between vectors without the need for exact nearest neighbor searches. The authors demonstrate how this approach can be used to accelerate nearest-neighbor searches in ClickHouse by creating a bit hash for each vector and using a hamming distance calculation to estimate distances. They also discuss the benefits and limitations of this approach, including its potential speedup of up to 10x over traditional brute-force search methods, but also acknowledge that it may not be as effective as graph-based approaches such as HNSW in certain cases. The authors provide guidance on tuning parameters and experimenting with different values for the number of bits/planes used in the LSH approach. Overall, this post provides an interesting and practical solution for accelerating nearest-neighbor searches in ClickHouse using SQL.