Querying
GROQ against Postgres: how queries are executed, what the perspectives mean, how search works and how to keep a query fast.
GROQ against Postgres
How a query is executed here: parsed with groq-js, narrowed by a SQL planner, evaluated completely — so full semantics are available from the first day.
Perspectives
published, drafts (and its previewDrafts alias) and raw — what each admits, what _id it reports, and the overlay rules that are easy to get wrong.
Full-text search
Each document carries a generated tsvector of its extracted plain text, Portable Text included, and text::match pushes down to a Postgres tsquery.
Keeping a query fast
Which predicates the planner can push into SQL, which it cannot, and how to shape a query so the expensive half never runs.
