Skip site navigation (1) Skip section navigation (2)

Re: encourging bitmap AND

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ben <midfield(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: encourging bitmap AND
Date: 2010-12-26 06:50:49
Message-ID: AANLkTimvWF7BZo8Ko+wExE+pCfeRqvnz-Qp--2w=7h3C@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Thu, Dec 23, 2010 at 22:52, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Ben <midfield(at)gmail(dot)com> writes:
>> i have a schema similar to the following
>
>> create index foo_s_idx on foo using btree (s);
>> create index foo_e_idx on foo using btree (e);
>
>> i want to do queries like
>
>> select * from foo where 150 between s and e;
>
> That index structure is really entirely unsuited to what you want to do,
> so it's not surprising that the planner isn't impressed with the idea of
> a bitmap AND.

Why is it unsuited for this query? It expands to (150 < s AND 150 > e)
 which should work nicely with bitmap AND as far as I can tell.

Regards,
Marti

In response to

Responses

pgsql-performance by date

Next:From: Jeff JanesDate: 2010-12-26 16:11:07
Subject: Re: concurrent IO in postgres?
Previous:From: Mladen GogalaDate: 2010-12-26 04:30:32
Subject: Re: concurrent IO in postgres?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group