Re: Choosing between seqscan and bitmap scan - Mailing list pgsql-hackers

From Oleg Bartunov
Subject Re: Choosing between seqscan and bitmap scan
Date
Msg-id Pine.LNX.4.64.1004291800370.7097@sn.sai.msu.ru
Whole thread Raw
In response to Re: Choosing between seqscan and bitmap scan  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Choosing between seqscan and bitmap scan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, 29 Apr 2010, Tom Lane wrote:

> Teodor Sigaev <teodor@sigaev.ru> writes:
>> [ planner prefers ]
>>     ->  Seq Scan on foo  (cost=0.00..5805.00 rows=4907 width=0)
>> to
>>     ->  Bitmap Heap Scan on foo  (cost=942.46..5755.08 rows=4907 width=0)
>
>> Why does pgsql choose seqscan (5817.28) instead of bitmap one (5767.36)?
>
> There's a fuzz factor of (IIRC) 1% in path cost comparisons.  It's
> deciding that the seqscan and bitmapscan total costs are not
> meaningfully different; then since the startup costs *are* meaningfully
> different, it's making the choice on the basis of cheaper startup cost.

hmm, what if we add index scan preference inside 1% tolerance ?

    Regards,        Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct
Next
From: Tom Lane
Date:
Subject: Re: Choosing between seqscan and bitmap scan