나의 발자취

CTE, HNSW 본문

카테고리 없음

CTE, HNSW

달모드 2026. 5. 26. 16:09

CTE (Common Table Expression) — a WITH ... AS (...) block in SQL. Think of it as a temporary named result set that only lives for the duration of that query. In the matching SQL, vector_search and bm25_search are two CTEs — the database runs them as separate sub-queries, then the final SELECT joins their results together via RRF. It's just a way to organize a complex query into readable steps.

HNSW (Hierarchical Navigable Small World) — an index structure that makes vector similarity search fast. Without it, finding the 100 most similar jobs out of thousands would mean comparing the resume vector against every job vector (slow). HNSW builds a graph where similar vectors are connected as neighbors, so the search can hop through the graph and find the closest matches in milliseconds instead of scanning everything.

Comments