pgvector — Vector Similarity Search
Stores embeddings + nearest-neighbor index. App-owned; MonPG reads index health.
pgvector is application-side. We don't need it to monitor PG, but if you have it installed, the Index Advisor and Tables page get pgvector-specific behavior:
- HNSW vs. IVFFlat index choice with a tuning hint based on your data shape.
- Index size growth curves — vector indexes get fat fast, and a graph of "size today vs. size 30 days ago" tells you whether you're heading for trouble.
- Recall vs. speed estimates derived from your actual query timings.
- Warning when recheck count is high, which usually means your
morefparameters are wrong.
Enabling
Pure DDL, no SPL, no restart. Available on RDS PG 15.2+, Azure Flex, Cloud SQL, Heroku, Crunchy, Aiven, and self-hosted.
CREATE EXTENSION vector;
-- Note: the extension name is "vector" (no "pg" prefix in pg_extension).
That naming inconsistency catches people; the extension's friendly name is pgvector but the system catalog identifier is just vector.
HNSW vs. IVFFlat
| HNSW | IVFFlat | |
|---|---|---|
| Speed | Faster query | Faster build |
| Memory | ~1.5-2× index size in RAM | Lower |
| Recall tuning | ef_search at query time | probes at query time |
| Build params | m, ef_construction | lists |
| Best for | Static / append-mostly data | Bulk loads + occasional updates |
The pgvector tuner
If you have an HNSW or IVFFlat index, the Index Advisor offers a Tuner button that runs your top-10 query patterns against several parameter combinations and reports the recall × latency tradeoff. Saves a manual SET ef_search grid search — and the recall measurement is the part most people get wrong by hand.