Order of index on multiple columns

Viewed 7238

Just a simple question, but does the order of your index matter when it spans over multiple columns?

For example, taking the query:

SELECT * FROM my_table WHERE (column_1 = 1 AND column_2 = 2)

If I want to add an index for a query like this, does it matter if my index is created like this:

CREATE INDEX my_index
ON my_table (column_1, column_2)

Or like this:

CREATE INDEX my_index
ON my_table (column_2, column_1)

Thanks for the help!

3 Answers
Related