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

Re: Choosing between seqscan and bitmap scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Choosing between seqscan and bitmap scan
Date: 2010-04-29 13:38:21
Message-ID: 10295.1272548301@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Teodor Sigaev <teodor(at)sigaev(dot)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.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-04-29 13:48:07
Subject: Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct
Previous:From: Dimitri FontaineDate: 2010-04-29 13:36:42
Subject: Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct

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