Re: Table Design question for gurus (without going to "NoSQL")... - Mailing list pgsql-general

From Phoenix Kiula
Subject Re: Table Design question for gurus (without going to "NoSQL")...
Date
Msg-id CAFWfU=so0Ugjf-2g8xBtAOmiTyvdTfjC-F1d+SGv3Pja+ub4Eg@mail.gmail.com
Whole thread Raw
In response to Re: Table Design question for gurus (without going to "NoSQL")...  ("Tomas Vondra" <tv@fuzzy.cz>)
List pgsql-general
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!

pgsql-general by date:

Previous
From: Phoenix Kiula
Date:
Subject: Re: Installed. Now what?
Next
From: Yeb Havinga
Date:
Subject: Re: Recommendations for SSDs in production?