Re: Index scans when bitmap scans disabled

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Index scans when bitmap scans disabled
Date: 2006-04-24 03:12:23
Message-ID: 19859.1145848343@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> Is it expected that the planner in 8.1.3 (CVS) and HEAD doesn't use
> an index scan for the second query below when bitmap scans are
> disabled?

You mean this one?

> test=> EXPLAIN SELECT * FROM foo WHERE id IN (1, 2);

That's not an indexable condition, ie, in general it can't be satisfied
with a single probe of the index.

> Here's the same query in 8.0.7:

> Index Scan using foo_pkey, foo_pkey on foo (cost=0.00..6.03 rows=2 width=4)
> Index Cond: ((id = 1) OR (id = 2))

We removed the repeated-indexscan plan type in favor of bitmap scans.
I'm not immediately aware of any reason why we shouldn't have ... if
there is any case where the pre-8.1 plan style wins, it'd have to be
a pretty narrow scenario.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Fuhr 2006-04-24 03:37:48 Re: Index scans when bitmap scans disabled
Previous Message Bruce Momjian 2006-04-24 02:58:31 Re: Additional current timestamp values