Choose an index for a query shape and a workload. An account's orders between two timestamps suggest an account equality key followed by the timestamp range. A report that searches all accounts by date has a different leading key. Check the plan and write costs before retaining both indexes.
PostgreSQL B-tree indexes work especially well when leading keys have equality conditions, followed by a range key. Later keys can still help, and recent PostgreSQL versions can sometimes skip groups, so a missing leading predicate doesn't make an index categorically unusable.
Covering indexes store the values a query needs. PostgreSQL's INCLUDE columns are payload rather than search keys, and visibility checks can still require heap reads. A partial index stores only rows satisfying its predicate; the planner must prove the query implies that predicate. DuckDB can store composite indexes, but its index scans use eligible single-column indexes. It doesn't implement those PostgreSQL clauses here. The runnable DDL tasks check definitions; the labeled examples teach PostgreSQL access decisions.
The DDL runs here. Catalog checks confirm index keys; they do not claim a production speedup.