Re: pgsql: Fix an oversight in the 8.2 patch that improved mergejoin

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)postgresql(dot)org>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix an oversight in the 8.2 patch that improved mergejoin
Date: 2008-09-06 14:38:10
Message-ID: 1220711890.4371.1321.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


On Sat, 2008-09-06 at 13:06 +0100, Gregory Stark wrote:
> tgl(at)postgresql(dot)org (Tom Lane) writes:
>
> > (The materialize protects the sort from having to support mark/restore,
> > allowing it to do its final merge pass on-the-fly.) We neglected to teach
> > cost_mergejoin about that hack, so it was failing to include the
> > materialize's costs in the estimated cost of the mergejoin.
>
> Is that right? The materialize is just doing the same writing that the final
> pass of the sort would have been doing. Did we discount the costs for sort for
> that skipping writing that final pass when that was done?

IIRC the cost of the sort didn't include the final merge, so when we
avoided the final merge the cost model for the sort became accurate.
Perhaps we should add something when we don't do that.

It seems reasonable than an extra node should cost something anyhow, and
the per tuple cost is the current standard way of indicating that extra
cost.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2008-09-06 18:23:35 Re: [COMMITTERS] pgsql: Fix an oversight in the 8.2 patch that improved mergejoin
Previous Message Gregory Stark 2008-09-06 12:06:04 Re: pgsql: Fix an oversight in the 8.2 patch that improved mergejoin

Browse pgsql-hackers by date

  From Date Subject
Next Message Ryan Bradetich 2008-09-06 14:56:05 Re: Fwd: [Patch Review] TRUNCATE Permission
Previous Message Andrew Dunstan 2008-09-06 13:32:38 pg_dump/pg_restore items