Search code examples
postgresqlindexingcovering-index

Does the include order has any impact on covering indexes?


Is there any difference between the two following indexes in PostgreSQL:

CREATE INDEX my_index ON table_name (column_one, column_two)
   INCLUDE (account_id, id)

and

CREATE INDEX my_index ON table_name (column_one, column_two)
   INCLUDE (id, account_id)

Solution

  • No, there is no difference in behavior between these two indexes. The order in the INCLUDE list does not matter.