diff options
Diffstat (limited to 'src/include/utils')
| -rw-r--r-- | src/include/utils/lsyscache.h | 3 | ||||
| -rw-r--r-- | src/include/utils/rel.h | 3 | ||||
| -rw-r--r-- | src/include/utils/tuplesort.h | 31 |
3 files changed, 14 insertions, 23 deletions
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h index 41e0c5162f..15d2b8a06d 100644 --- a/src/include/utils/lsyscache.h +++ b/src/include/utils/lsyscache.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.110 2007/01/05 22:19:59 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.111 2007/01/09 02:14:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -37,6 +37,7 @@ extern Oid get_opfamily_member(Oid opfamily, Oid lefttype, Oid righttype, int16 strategy); extern bool get_op_mergejoin_info(Oid eq_op, Oid *left_sortop, Oid *right_sortop, Oid *opfamily); +extern bool get_op_compare_function(Oid opno, Oid *cmpfunc, bool *reverse); extern Oid get_op_hash_function(Oid opno); extern void get_op_btree_interpretation(Oid opno, List **opfamilies, List **opstrats); diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index ae81b7483e..c8b78b9542 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.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/utils/rel.h,v 1.94 2007/01/05 22:19:59 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.95 2007/01/09 02:14:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -189,6 +189,7 @@ typedef struct RelationData Oid *rd_operator; /* OIDs of index operators */ RegProcedure *rd_support; /* OIDs of support procedures */ FmgrInfo *rd_supportinfo; /* lookup info for support procedures */ + int16 *rd_indoption; /* per-column AM-specific flags */ List *rd_indexprs; /* index expression trees, if any */ List *rd_indpred; /* index predicate tree, if any */ void *rd_amcache; /* available for use by index AM */ diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h index 2ee315d855..cea50b4836 100644 --- a/src/include/utils/tuplesort.h +++ b/src/include/utils/tuplesort.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/tuplesort.h,v 1.24 2007/01/05 22:20:00 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/tuplesort.h,v 1.25 2007/01/09 02:14:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -45,14 +45,14 @@ typedef struct Tuplesortstate Tuplesortstate; */ extern Tuplesortstate *tuplesort_begin_heap(TupleDesc tupDesc, - int nkeys, - Oid *sortOperators, AttrNumber *attNums, + int nkeys, AttrNumber *attNums, + Oid *sortOperators, bool *nullsFirstFlags, int workMem, bool randomAccess); extern Tuplesortstate *tuplesort_begin_index(Relation indexRel, bool enforceUnique, int workMem, bool randomAccess); extern Tuplesortstate *tuplesort_begin_datum(Oid datumType, - Oid sortOperator, + Oid sortOperator, bool nullsFirstFlag, int workMem, bool randomAccess); extern void tuplesort_puttupleslot(Tuplesortstate *state, @@ -84,28 +84,17 @@ 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_REVLT, /* raw "<" operator, but reverse NULLs */ - 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); +/* Setup for ApplySortFunction */ +extern void SelectSortFunction(Oid sortOperator, bool nulls_first, + Oid *sortFunction, + int *sortFlags); /* * Apply a sort function (by now converted to fmgr lookup form) * and return a 3-way comparison result. This takes care of handling - * NULLs and sort ordering direction properly. + * reverse-sort and NULLs-ordering properly. */ -extern int32 ApplySortFunction(FmgrInfo *sortFunction, SortFunctionKind kind, +extern int32 ApplySortFunction(FmgrInfo *sortFunction, int sortFlags, Datum datum1, bool isNull1, Datum datum2, bool isNull2); |
