Re: 1-/2-dimensional indexes for common columns, rationale?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!

--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux