summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-05-21 17:57:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-05-21 17:57:35 +0000
commit2415ad983174164ff30ce487c0e6b4b53321b83a (patch)
tree8f3bae7fd588a6cfa9bcaf33e6e5ea5f1cf89a4d /src/include/optimizer
parent3963574d13383b4f377ab054e47e4af20cb75e7d (diff)
downloadpostgresql-2415ad983174164ff30ce487c0e6b4b53321b83a.tar.gz
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.
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/cost.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 641555b706..138741e07a 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.86 2007/05/04 01:13:45 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.87 2007/05/21 17:57:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,6 +75,7 @@ extern void cost_valuesscan(Path *path, PlannerInfo *root,
extern void cost_sort(Path *path, PlannerInfo *root,
List *pathkeys, Cost input_cost, double tuples, int width,
double limit_tuples);
+extern bool sort_exceeds_work_mem(Sort *sort);
extern void cost_material(Path *path,
Cost input_cost, double tuples, int width);
extern void cost_agg(Path *path, PlannerInfo *root,