Thread: pgsql: Teach tuplestore.c to throw away data before the "mark" point
pgsql: Teach tuplestore.c to throw away data before the "mark" point
From
tgl@postgresql.org (Tom Lane)
Date:
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)
"Tom Lane" <tgl@postgresql.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