Re: Forcing more agressive index scans for BITMAP AND

From: Matthew <matthew(at)flymine(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Forcing more agressive index scans for BITMAP AND
Date: 2008-04-04 10:40:30
Message-ID: Pine.LNX.4.64.0804041137500.20402@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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|||/
' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-'

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message PFC 2008-04-04 11:02:59 Re: Forcing more agressive index scans for BITMAP AND
Previous Message Tom Lane 2008-04-04 05:49:27 Re: Query plan excluding index on view