| From: | Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com> |
|---|---|
| To: | Tomas Vondra <tv(at)fuzzy(dot)cz> |
| Cc: | David Johnston <polobo(at)yahoo(dot)com>, Gavin Flower <gavinflower(at)archidevsys(dot)co(dot)nz>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Table Design question for gurus (without going to "NoSQL")... |
| Date: | 2011-11-24 12:23:54 |
| Message-ID: | CAFWfU=so0Ugjf-2g8xBtAOmiTyvdTfjC-F1d+SGv3Pja+ub4Eg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Mon, Nov 21, 2011 at 6:14 PM, Tomas Vondra <tv(at)fuzzy(dot)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!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Yeb Havinga | 2011-11-24 13:20:59 | Re: Recommendations for SSDs in production? |
| Previous Message | Phoenix Kiula | 2011-11-24 12:14:28 | Re: Installed. Now what? |