Re: slow bitmap heap scans on pg 9.2

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: "ktm(at)rice(dot)edu" <ktm(at)rice(dot)edu>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: slow bitmap heap scans on pg 9.2
Date: 2013-04-10 18:15:34
Message-ID: CAMkU=1zStPnEh7dghTusj1=E6v50g-e2O2Cdd6bncpFfd9=Q1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Apr 10, 2013 at 8:56 AM, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>wrote:

> On 13-04-10 09:56 AM, ktm(at)rice(dot)edu wrote:
>
>> On Wed, Apr 10, 2013 at 09:49:55AM -0400, Steve Singer wrote:
>>
>
>
>> Hi Steve,
>>
>> The one thing that stands out to me is that you are working with 200GB of
>> data on a machine with 4-8GB of ram and you have the random_page_cost set
>> to 2.0. That is almost completely uncached and I would expect a value of
>> 10 or more to be closer to reality.
>>
>
> Setting random_page_cost to 15 makes the planner choose the nested-loop
> plan (at least the date range I tried).
>
> I thought that the point of effective cache size was to tell the planner
> high likely it is for a random page to be in cache.

e_c_s tells it how likely it is to still be in cache the second (and
subsequent) time the page is visited during the *same query*. It doesn't
tell it how likely it is to be in cache the first time it is needed in a
given query. (Also, e_c_s is irrelevant for bitmap scans, as they
inherently hit every block only once)

Also, it doesn't tell how expensive it is to bring it into cache when it is
needed. That is what random_page_cost is for. If you tell that those
fetches are going to be cheap, then it doesn't matter so much how many of
them it is going to have to do.

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tory M Blue 2013-04-10 21:25:05 Postgresql.conf file from like 7.x to 9.2
Previous Message Jeff Janes 2013-04-10 18:06:16 Re: slow bitmap heap scans on pg 9.2