mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Create a "sort support" interface API for faster sorting.
This patch creates an API whereby a btree index opclass can optionally provide non-SQL-callable support functions for sorting. In the initial patch, we only use this to provide a directly-callable comparator function, which can be invoked with a bit less overhead than the traditional SQL-callable comparator. While that should be of value in itself, the real reason for doing this is to provide a datatype-extensible framework for more aggressive optimizations, as in Peter Geoghegan's recent work. Robert Haas and Tom Lane
This commit is contained in:
@@ -116,19 +116,4 @@ extern void tuplesort_rescan(Tuplesortstate *state);
|
||||
extern void tuplesort_markpos(Tuplesortstate *state);
|
||||
extern void tuplesort_restorepos(Tuplesortstate *state);
|
||||
|
||||
/* 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
|
||||
* reverse-sort and NULLs-ordering properly.
|
||||
*/
|
||||
extern int32 ApplySortFunction(FmgrInfo *sortFunction, int sortFlags,
|
||||
Oid collation,
|
||||
Datum datum1, bool isNull1,
|
||||
Datum datum2, bool isNull2);
|
||||
|
||||
#endif /* TUPLESORT_H */
|
||||
|
Reference in New Issue
Block a user