Q44 PostgreSQL Domain 2 · 25–30% of exam

A query uses ORDER BY embedding <-> query_vec LIMIT 10. The table has 1M rows but no vector index. What is the query behaviour?

  1. A Uses B-tree index automatically
  2. B Returns an error (no vector index)
  3. C Performs a full sequential scan computing distance for all rows (correct answer)
  4. D Uses approximate search with default parameters

Shortcut: Without a vector index, pgvector performs an exact k-NN search via full sequential scan. This provides perfect recall but is slow on large tables. Add IVFFlat or HNSW index for performance.