diff options
Diffstat (limited to 'src/include/utils/tuplesort.h')
-rw-r--r-- | src/include/utils/tuplesort.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h index 7f273776c36..001761796e2 100644 --- a/src/include/utils/tuplesort.h +++ b/src/include/utils/tuplesort.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: tuplesort.h,v 1.6 2001/01/24 19:43:29 momjian Exp $ + * $Id: tuplesort.h,v 1.7 2001/05/07 00:43:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -36,8 +36,9 @@ typedef struct Tuplesortstate Tuplesortstate; */ extern Tuplesortstate *tuplesort_begin_heap(TupleDesc tupDesc, - int nkeys, ScanKey keys, - bool randomAccess); + int nkeys, + Oid *sortOperators, AttrNumber *attNums, + bool randomAccess); extern Tuplesortstate *tuplesort_begin_index(Relation indexRel, bool enforceUnique, bool randomAccess); @@ -75,4 +76,19 @@ extern void tuplesort_rescan(Tuplesortstate *state); extern void tuplesort_markpos(Tuplesortstate *state); extern void tuplesort_restorepos(Tuplesortstate *state); +/* + * This routine selects an appropriate sorting function to implement + * a sort operator as efficiently as possible. + */ +typedef enum +{ + SORTFUNC_LT, /* raw "<" operator */ + SORTFUNC_CMP, /* -1 / 0 / 1 three-way comparator */ + SORTFUNC_REVCMP /* 1 / 0 / -1 (reversed) 3-way comparator */ +} SortFunctionKind; + +extern void SelectSortFunction(Oid sortOperator, + RegProcedure *sortFunction, + SortFunctionKind *kind); + #endif /* TUPLESORT_H */ |