Re: 1-/2-dimensional indexes for common columns, rationale? - Mailing list pgsql-performance

From Matthew
Subject Re: 1-/2-dimensional indexes for common columns, rationale?
Date
Msg-id Pine.LNX.4.64.0803261510290.20402@aragorn.flymine.org
Whole thread Raw
In response to Re: 1-/2-dimensional indexes for common columns, rationale?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: 1-/2-dimensional indexes for common columns, rationale?
List pgsql-performance
On Wed, 26 Mar 2008, A. Kretschmer wrote:
>> create index foo1 on bla (a);
>> create index foo2 on bla (b);
>> create index foo3 on bla (a,b);
>
> Which version do you have? Since 8.1 pg can use a so called 'bitmap
> index scan', because of this feature i guess you don't need the index
> foo3. (if you have 8.1 or higher)

Depending on your query, the bitmap index scan could be a good deal slower
than index foo3.

All of this depends on what queries you are going to be running, and how
much you value insert performance compared to select performance. I know
that foo3 can do everything that foo1 can, so foo1 could be viewed as
redundant. I'd be interested in hearing from the Powers That Be whether
foo2 is redundant too. It wasn't a while back.

My impression is that foo3 isn't much more expensive to alter than foo1 -
is that correct?

Matthew

--
Lord grant me patience, and I want it NOW!

pgsql-performance by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: 1-/2-dimensional indexes for common columns, rationale?
Next
From: Marinos Yannikos
Date:
Subject: Re: 1-/2-dimensional indexes for common columns, rationale?