// troubleshooting guide · pgvector
pgvector Index Not Being Used
- Status
- Fixed in latest version
- platforms:
- All
- updated:
- November 15, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · pgvector/index-not-used3 FIXES
// quick answer
The planner uses the index only for ORDER BY on a distance operator, ascending, with LIMIT, and a matching operator class.
Most likely fix: Fix the query shape
How to fix it
// try these in order, the most common fix is first
FIX 1Fix the query shape
- 01Use ORDER BY embedding <=> $1 LIMIT k directly on the table
- 02Avoid ORDER BY 1 - (embedding <=> ...) DESC
Did this fix it?FIX 2Match operator class
- 01Cosine needs vector_cosine_ops, L2 vector_l2_ops, inner product vector_ip_ops
Did this fix it?FIX 3Diagnose
- 01Run EXPLAIN (ANALYZE, BUFFERS)
- 02Run ANALYZE on the table
- 03In a transaction try SET LOCAL enable_seqscan = off to see if cost is the issue
Did this fix it?
Symptoms
EXPLAIN shows Seq Scan instead of an index scan.
Why it happens
- C-01Wrapped or descending ORDER BY
- C-02Distance computed in a subquery and sorted on alias
- C-03Operator class mismatch
- C-04Small table or stale stats
// this guide also covers
- pgvector index not used
- pgvector sequential scan
- pgvector explain analyze seq scan
Still not working?
If pgvector keeps failing, you're not alone. See every pgvector problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther pgvector errors
- pgvector Error: extension "vector" is not available
- pgvector HNSW Index Build Slow
- pgvector "operator does not exist: vector <=>" Error
- pgvector Dimension Limit: Cannot Index More Than 2000 Dimensions
- pgvector "different vector dimensions" Error
- pgvector Query Returns Fewer Results Than LIMIT With Filter
- pgvector HNSW Build Out of Memory or Shared Memory Error
- How to Enable pgvector on Supabase