summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2006-02-19 05:54:06 +0000
committerTom Lane2006-02-19 05:54:06 +0000
commitdf700e6b40195d28dc764e0c694ac8cef90d4638 (patch)
tree422c45bed536dbfba7141aff82af7ca767aa0627 /src/include
parent85c0eac1afd92201638a4af6ab6e936f47727551 (diff)
Improve tuplesort.c to support variable merge order. The original coding
with fixed merge order (fixed number of "tapes") was based on obsolete assumptions, namely that tape drives are expensive. Since our "tapes" are really just a couple of buffers, we can have a lot of them given adequate workspace. This allows reduction of the number of merge passes with consequent savings of I/O during large sorts. Simon Riggs with some rework by Tom Lane
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/tuplesort.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index 3947077e127..2aaa7d9c4fe 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/tuplesort.h,v 1.17 2004/12/31 22:03:46 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/utils/tuplesort.h,v 1.18 2006/02/19 05:54:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -67,6 +67,8 @@ extern bool tuplesort_getdatum(Tuplesortstate *state, bool forward,
extern void tuplesort_end(Tuplesortstate *state);
+extern int tuplesort_merge_order(long allowedMem);
+
/*
* These routines may only be called if randomAccess was specified 'true'.
* Likewise, backwards scan in gettuple/getdatum is only allowed if