-
-
Notifications
You must be signed in to change notification settings - Fork 18
Leading/left-most on compound index? #10
Copy link
Copy link
Open
Description
I have a query that uses a compound index like (customer_id, is_premium). The index advisor wants me to add an index for customer_id but Postgres is using the compoound index (as confirmed by EXPLAIN) and note that the docs say:
A multicolumn B-tree index can be used with query conditions that involve any subset of the index's columns, but the index is most efficient when there are constraints on the leading (leftmost) column
https://www.postgresql.org/docs/current/indexes-multicolumn.html
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels