Re: Hash or merge join instead of inner loop - Mailing list pgsql-performance

From Shridhar Daithankar
Subject Re: Hash or merge join instead of inner loop
Date
Msg-id 3EE5EA89.19260.8C8B669@localhost
Whole thread Raw
In response to Re: Hash or merge join instead of inner loop  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
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?

Bye
 Shridhar

--
All new:    Parts not interchangeable with previous model.


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hash or merge join instead of inner loop
Next
From: Josh Berkus
Date:
Subject: Re: FW: [ADMIN] Shared_buffers and kernel parameters, tuning