help understanding the bitmap heap scan costs

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: help understanding the bitmap heap scan costs
Date: 2012-05-21 13:35:55
Message-ID: CAKoxK+6JDz+-=hC_22k4xfombP3OOsH0C69hq-4+cxaSSxNppw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,
I don't fully understand how is the cost of a bitmap heap scan
computed. For instance when the explain output node is similar to the
following:

Bitmap Heap Scan on test (cost=17376.49..48595.93 rows=566707 width=6)
Recheck Cond: ((text1 = 'A'::text) OR (text1 = 'C'::text))
Filter: (num1 > 1)

how is the cost of the node (48595.93 - 17376.49) computed? I think it
should be something like:
(reltuples * ( index_filtering_factor_A + index_filtering_factor_B) )
* (cpu_tuple_cost + cpu_operator_cost)
+ (reltuples * ( index_filtering_factor_A + index_filtering_factor_B)
) / tuples_per_pages

but this does not equal the optimizer cost, so I guess I'm doing
something wrong. Suggestions?

Thanks,
Luca

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2012-05-21 13:38:03 Re: Concerning about Unicode-aware string handling
Previous Message Vincas Dargis 2012-05-21 13:31:56 Re: Concerning about Unicode-aware string handling