On Mon, Nov 21, 2011 at 6:14 PM, Tomas Vondra <tv@fuzzy.cz> wrote:
.....
>>
>> An index on (a, b) can be used for queries involving only a but not for
>> those involving only b.
>
> That is not true since 8.2 - a multi-column index may be used even for
> queries without conditions on leading columns. It won't be as effective as
> with conditions on leading columns, because the whole index must be
> scanned, but it's usually much cheaper than keeping two indexes (memory
> requirements, overhead when inserting data etc.)
>
> Check this:
> http://www.postgresql.org/docs/8.2/interactive/indexes-multicolumn.html
Thanks Tomas. VERY useful information.
I've decided to go with a unique multicolumn index for now.
Will ask the experts here if I see some issues..
Thanks!