Keyword, Semantic, or Both? A Field Guide to Search in Postgres
Thursday, October 01 · 16:00–16:50
"Should we add Elasticsearch? Do we need a vector database?" Before you add a second system, it's worth knowing what Postgres can do today, because the answer changed a lot in the last year. This is a field guide to search inside PostgreSQL, for people who've never built it and people who've built it the hard way. We'll start with keyword search: LIKE, trigrams, tsvector, and real BM25 ranking with pg_textsearch. Then semantic search: exact scans, pgvector's IVFFlat and HNSW, and newer designs such as pg_vectorsearch, whose PRISM index replaces a graph over every vector with compressed, SIMD-scanned posting lists. Finally, we'll combine both into one hybrid SQL query. Along the way we'll cover what PostgreSQL 18 and the 19 beta added for search workloads, build and inspect a PRISM index live, and turn the one knob that trades speed for recall. The goal isn't to crown a winner. It's to make "use a separate search system" a conclusion you reach after measuring, not a reflex you perform before coffee. You'll leave with - A mental model of keyword vs. semantic search, and when each one fails. - A map of today's Postgres search options and the workload each one fits. - A working hybrid query and a checklist for evaluating any search index honestly.