Re: Forcing more agressive index scans for BITMAP AND - Mailing list pgsql-performance

From Matthew
Subject Re: Forcing more agressive index scans for BITMAP AND
Date
Msg-id Pine.LNX.4.64.0804041137500.20402@aragorn.flymine.org
Whole thread Raw
In response to Forcing more agressive index scans for BITMAP AND  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Responses Re: Forcing more agressive index scans for BITMAP AND
List pgsql-performance
On Fri, 4 Apr 2008, Ow Mun Heng wrote:
> select * from table
> where A=X
> and B = Y
> and C = Z
> and D = AA
> and E = BB

This may not be the answer you're looking for, but if you create a
multi-coloumn index, it should be able to make your query run fast:

CREATE INDEX foo ON table (A, B, C, D, E);

It'll certainly be faster than building a bitmap for the contents of five
separate indexes.

Matthew

--
-. .-.   .-. .-.   .-. .-.   .-. .-.   .-. .-.   .-. .-.   .-.
||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||
|/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/
'   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-' `-'

pgsql-performance by date:

Previous
From: Ow Mun Heng
Date:
Subject: Forcing more agressive index scans for BITMAP AND
Next
From: PFC
Date:
Subject: Re: Forcing more agressive index scans for BITMAP AND