Re: cost_nonsequential_access()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: cost_nonsequential_access()
Date: 2004-06-08 15:13:43
Message-ID: 1788.1086707623@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
> The comment describing cost_nonsequential_access() says that the two
> functions "meet in the middle". They meet at random_page_cost/2,
> however, not in the middle between 1 and random_page_cost. For
> random_page_cost < 2 the result can be less than 1 for relpages near
> effective_cache_size. I don't think that this was intended.

You're right, I failed to consider that random_page_cost might be less
than 2.

> This patch makes sure that cost_nonsequential_access() is always between
> 1 and randon_page_cost and the functions meet a (1+random_page_cost)/2.

This patch seems to do considerably more violence to the equations than
is needed to cover that oversight, though. The old behavior was
intentionally nonlinear in relsize; this is not.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Fabien COELHO 2004-06-08 15:38:16 Re: fix schema ownership for database owner on first
Previous Message Tom Lane 2004-06-08 14:50:23 Re: fix schema ownership for database owner on first connection