13 lines
731 B
SQL
13 lines
731 B
SQL
-- The ivfflat index built with lists=100 against a near-empty table has such
|
|
-- low recall that ORDER BY ... LIMIT queries silently return zero rows
|
|
-- (confirmed 2026-09-12: a single-row table returned no match under LIMIT,
|
|
-- and matched only after `SET ivfflat.probes = 10`). This is exactly what
|
|
-- Postgres warned about when creating the index ("This will cause low
|
|
-- recall... Drop the index until the table has more data").
|
|
--
|
|
-- Dropping it now: a sequential scan is correct and fast enough at this
|
|
-- data volume. Recreate an ivfflat (or hnsw) index once document_chunks
|
|
-- has enough rows for meaningful centroids (pgvector docs suggest
|
|
-- lists ~= sqrt(row_count)).
|
|
DROP INDEX IF EXISTS idx_document_chunks_embedding;
|