When is a partial index useful in PostgreSQL?
The orders table contains tens of millions of rows, but only a small fraction have status new. The application frequently runs SELECT id FROM orders WHERE status = 'new' AND created_at >= '2026-11-01'. What partial index would you create for this query in PostgreSQL? How could it be more efficient than a full index? Under what conditions would the planner be unable to use it?
ExplainIndexesMiddleBackendData EngineerAnalyst