Re: reducing random_page_cost from 4 to 2 to force index scan - Mailing list pgsql-performance

From Robert Haas
Subject Re: reducing random_page_cost from 4 to 2 to force index scan
Date
Msg-id BANLkTimTqXAy7_KqQz_OW1RvMbDd9ojfqg@mail.gmail.com
Whole thread Raw
In response to Re: reducing random_page_cost from 4 to 2 to force index scan  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: reducing random_page_cost from 4 to 2 to force index scan
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: reducing random_page_cost from 4 to 2 to force index scan
Next
From: Josh Berkus
Date:
Subject: Re: reducing random_page_cost from 4 to 2 to force index scan