Q38 PostgreSQL Domain 2 · 25–30% of exam Priority · Real Exam

A query filters on tenant_id then orders by vector distance. Which index strategy is most effective?

  1. A A single HNSW index on the vector only
  2. B Partial HNSW indexes per tenant, or a composite B-tree on tenant_id plus HNSW with sufficient ef_search (correct answer)
  3. C A B-tree on the vector column
  4. D No index

Shortcut: Pre-filtering interacts poorly with approximate indexes because the filter can eliminate most graph candidates. Partitioning or partial indexes per tenant keeps recall high under filtering.