Re: bitmap index scan problem?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: stig erikson <stigerikson_nospam_(at)yahoo(dot)se>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: bitmap index scan problem?
Date: 2006-09-10 17:50:06
Message-ID: 25494.1157910606@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

stig erikson <stigerikson_nospam_(at)yahoo(dot)se> writes:
> the question is simply why the planner is not smart enough to skip the bitmap scan if normal operation is faster.

Probably because it hasn't got good statistics about the distribution of
"bid":

> -> Bitmap Index Scan on bid_index (cost=0.00..44.51 rows=7576 width=0) (actual time=0.137..0.137 rows=506 loops=1)
> Index Cond: (bid = 17675)

When the rowcount estimate is off by more than a factor of 10, the costs
are going to be wrong too. Try increasing the statistics target for this
table.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2006-09-10 19:03:13 Re: BUG #2611: 2 instalation probs: invalid directory and user account creation
Previous Message Sven Kirsten 2006-09-08 17:47:26 BUG #2612: Strange behavior of incremented_by