From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Sok Ann Yap <sokann@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: reducing random_page_cost from 4 to 2 to force index scan
Date: Fri, 13 May 2011 16:04:39 -0400
Message-ID: <BANLkTimTqXAy7_KqQz_OW1RvMbDd9ojfqg@mail.gmail.com> (raw)
In-Reply-To: <2823.1305314437@sss.pgh.pa.us>
References: <BANLkTikZhYc+h1=YDJfXwZEZc1tN3_VwCg@mail.gmail.com>
<4DB6F4BB020000250003CEB9@gw.wicourts.gov>
<BANLkTindB68ogMg8zrR7GrYEV+mQQddj0A@mail.gmail.com>
<BANLkTik6OaVkJGEjs5--vcynUE36mWbzbg@mail.gmail.com>
<2823.1305314437@sss.pgh.pa.us>
On Fri, May 13, 2011 at 3:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Tue, Apr 26, 2011 at 9:04 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>>> The very first thing to check is effective_cache_size and to set it to
>>> a reasonable value.
>
>> Actually, effective_cache_size has no impact on costing except when
>> planning a nested loop with inner index scan. So, a query against a
>> single table can never benefit from changing that setting.
>
> That's flat out wrong. It does affect the cost estimate for plain
> indexscan (and bitmap indexscan) plans.
<rereads code>
OK, I agree. I obviously misinterpreted this code the last time I read it.
I guess maybe the reason why it didn't matter for the OP is that - if
the size of the index page in pages is smaller than the pro-rated
fraction of effective_cache_size allowed to the index - then the exact
value doesn't affect the answer.
I apparently need to study this code more.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: robertmhaas@gmail.com, tgl@sss.pgh.pa.us, mmoncure@gmail.com, Kevin.Grittner@wicourts.gov, sokann@gmail.com
Subject: Re: reducing random_page_cost from 4 to 2 to force index scan
In-Reply-To: <BANLkTimTqXAy7_KqQz_OW1RvMbDd9ojfqg@mail.gmail.com>
References: <BANLkTikZhYc+h1=YDJfXwZEZc1tN3_VwCg@mail.gmail.com> <4DB6F4BB020000250003CEB9@gw.wicourts.gov> <BANLkTindB68ogMg8zrR7GrYEV+mQQddj0A@mail.gmail.com> <BANLkTik6OaVkJGEjs5--vcynUE36mWbzbg@mail.gmail.com> <2823.1305314437@sss.pgh.pa.us> <BANLkTimTqXAy7_KqQz_OW1RvMbDd9ojfqg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox