mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +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:
@ -279,7 +279,7 @@ extern void pg_lltoa(int64 ll, char *a);
|
||||
|
||||
/*
|
||||
* Per-opclass comparison functions for new btrees. These are
|
||||
* stored in pg_amproc and defined in access/nbtree/nbtcompare.c
|
||||
* stored in pg_amproc; most are defined in access/nbtree/nbtcompare.c
|
||||
*/
|
||||
extern Datum btboolcmp(PG_FUNCTION_ARGS);
|
||||
extern Datum btint2cmp(PG_FUNCTION_ARGS);
|
||||
@ -304,6 +304,19 @@ extern Datum btcharcmp(PG_FUNCTION_ARGS);
|
||||
extern Datum btnamecmp(PG_FUNCTION_ARGS);
|
||||
extern Datum bttextcmp(PG_FUNCTION_ARGS);
|
||||
|
||||
/*
|
||||
* Per-opclass sort support functions for new btrees. Like the
|
||||
* functions above, these are stored in pg_amproc; most are defined in
|
||||
* access/nbtree/nbtcompare.c
|
||||
*/
|
||||
extern Datum btint2sortsupport(PG_FUNCTION_ARGS);
|
||||
extern Datum btint4sortsupport(PG_FUNCTION_ARGS);
|
||||
extern Datum btint8sortsupport(PG_FUNCTION_ARGS);
|
||||
extern Datum btfloat4sortsupport(PG_FUNCTION_ARGS);
|
||||
extern Datum btfloat8sortsupport(PG_FUNCTION_ARGS);
|
||||
extern Datum btoidsortsupport(PG_FUNCTION_ARGS);
|
||||
extern Datum btnamesortsupport(PG_FUNCTION_ARGS);
|
||||
|
||||
/* float.c */
|
||||
extern PGDLLIMPORT int extra_float_digits;
|
||||
|
||||
|
Reference in New Issue
Block a user