Re: bitmap index scan problem? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: bitmap index scan problem?
Date
Msg-id 25494.1157910606@sss.pgh.pa.us
Whole thread Raw
In response to bitmap index scan problem?  (stig erikson <stigerikson_nospam_@yahoo.se>)
Responses Re: bitmap index scan problem?
List pgsql-bugs
stig erikson <stigerikson_nospam_@yahoo.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=506loops=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

pgsql-bugs by date:

Previous
From: Chris Browne
Date:
Subject: Re: BUG #2608: dblink compile fails on AIX 5.3
Next
From: "Magnus Hagander"
Date:
Subject: Re: BUG #2611: 2 instalation probs: invalid directory and user account creation