Reputation: 349
Given a DB with a primary index on the columns foo and bar, is it worthwhile adding an individual index on the single column foo (assuming that most queries are ... WHERE foo = '...')? If it makes a difference, I'm on pgsql.
Upvotes: 1
Views: 111
Reputation: 7996
If index is (foo,bar)
- in this order, you don't need another index on foo
.
Otherwise you do.
Upvotes: 2