
PostgreSQL can explain complex queries like vector reranked with BM25 RRF
Vector search with BM25 reranking (RRF – Reciprocal Rank Fusion), filters, and facets can become complex very quickly: * You’re combining multiple rankings (e.g., BM25 + vector similarity). * You’re applying post-filtering or pre-filtering (categories, availability, dates, etc.). * You’re computing facets/aggregations on top of already-ranked results. * And sometimes you’re adding re-sorting (e.g., by date or popularity after relevance). That’s where PostgreSQL really shines. With `EXPLAIN (ANALYZE, BUFFERS)` you can: * See whether your vector index (IVFFlat / HNSW) is actually used. * Check if filters are applied before or after similarity search. * Detect expensive bitmap heap scans or unnecessary sequential scans. * Measure the real cost of CTEs vs. subqueries. * Understand how RRF is materialized (temporary sort, window function, hash aggregation).







