PostgreSQL: index design and query plan optimization
When to use
Use this skill for index design and query plan optimization in PostgreSQL. This skill specifically handles index design and query plan optimization and nothing else in the PostgreSQL family.
Procedure
Analyze slow queries with EXPLAIN ANALYZE, choose between B-tree, GIN, BRIN and partial indexes, and rewrite predicates so the planner uses them. Drop redundant indexes.
Notes
This is the PostgreSQL skill dedicated to index design and query plan optimization. Sibling skills cover other PostgreSQL capabilities; this one is the right choice only when the task is about index design and query plan optimization.