On 10 Jun 2003 at 2:15, Tom Lane wrote:
> There's been some discussion about that before; you could check the
> archives (now that they're up again ;-)). I believe that the planner
> overestimates the cost of a nestloop with inner indexscan, because it
> costs the indexscans as though each one is an independent ab-initio
> index search. In reality, most of the upper btree levels will no doubt
> stay in memory during such a query, and so this estimate charges many
> more reads than really occur. Fixing this is on the todo list, but no
> one's got to it yet. (It's not clear to me how to put the consideration
> into the planner's cost algorithms in a clean way.)
Just being naïve here, but if planner and executor account for shared
buffers+effective OS cache, even a boolean choice could be a start.
Say a query needs 100MB of data according to estimates so if shared
buffers+effective OS cache covers that, we can lower the cost.
May be we should have two config. parameters for tuple cost? Disk read tuple
cost and memory read tuple cost. Later being 1/10th of former?
All new: Parts not interchangeable with previous model.
In response to
pgsql-performance by date
|Next:||From: Josh Berkus||Date: 2003-06-10 15:46:21|
|Subject: Re: FW: [ADMIN] Shared_buffers and kernel parameters, tuning|
|Previous:||From: Tom Lane||Date: 2003-06-10 06:15:11|
|Subject: Re: Hash or merge join instead of inner loop |