Re: pgsql: Teach tuplestore.c to throw away data before the "mark" point

Lists: pgsql-committers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Teach tuplestore.c to throw away data before the "mark" point
Date: 2007-05-21 17:57:35
Message-ID: 20070521175735.40C8B9FB4B9@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Log Message:
-----------
Teach tuplestore.c to throw away data before the "mark" point when the caller
is using mark/restore but not rewind or backward-scan capability. Insert a
materialize plan node between a mergejoin and its inner child if the inner
child is a sort that is expected to spill to disk. The materialize shields
the sort from the need to do mark/restore and thereby allows it to perform
its final merge pass on-the-fly; while the materialize itself is normally
cheap since it won't spill to disk unless the number of tuples with equal
key values exceeds work_mem.

Greg Stark, with some kibitzing from Tom Lane.

Modified Files:
--------------
pgsql/src/backend/executor:
nodeMaterial.c (r1.58 -> r1.59)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMaterial.c.diff?r1=1.58&r2=1.59)
nodeMergejoin.c (r1.87 -> r1.88)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMergejoin.c.diff?r1=1.87&r2=1.88)
pgsql/src/backend/optimizer/path:
costsize.c (r1.182 -> r1.183)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/costsize.c.diff?r1=1.182&r2=1.183)
pgsql/src/backend/optimizer/plan:
createplan.c (r1.230 -> r1.231)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c.diff?r1=1.230&r2=1.231)
pgsql/src/backend/utils/sort:
tuplestore.c (r1.30 -> r1.31)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/sort/tuplestore.c.diff?r1=1.30&r2=1.31)
pgsql/src/include/nodes:
execnodes.h (r1.174 -> r1.175)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h.diff?r1=1.174&r2=1.175)
pgsql/src/include/optimizer:
cost.h (r1.86 -> r1.87)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/cost.h.diff?r1=1.86&r2=1.87)
pgsql/src/include/utils:
tuplestore.h (r1.20 -> r1.21)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/tuplestore.h.diff?r1=1.20&r2=1.21)


From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)postgresql(dot)org>
Cc: <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Teach tuplestore.c to throw away data before the "mark" point
Date: 2007-05-22 20:37:38
Message-ID: 87veek8ui5.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers


"Tom Lane" <tgl(at)postgresql(dot)org> writes:

> Log Message:
> -----------
> Teach tuplestore.c to throw away data before the "mark" point when the caller
> is using mark/restore but not rewind or backward-scan capability.
>...
> Greg Stark, with some kibitzing from Tom Lane.

Fwiw most of this code -- and by the sounds of it, all the code actually
committed -- came from Simon Riggs.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com