postgresql/src/include/lib
Robert Haas 4ea51cdfe8 Use abbreviated keys for faster sorting of text datums.
This commit extends the SortSupport infrastructure to allow operator
classes the option to provide abbreviated representations of Datums;
in the case of text, we abbreviate by taking the first few characters
of the strxfrm() blob.  If the abbreviated comparison is insufficent
to resolve the comparison, we fall back on the normal comparator.
This can be much faster than the old way of doing sorting if the
first few bytes of the string are usually sufficient to resolve the
comparison.

There is the potential for a performance regression if all of the
strings to be sorted are identical for the first 8+ characters and
differ only in later positions; therefore, the SortSupport machinery
now provides an infrastructure to abort the use of abbreviation if
it appears that abbreviation is producing comparatively few distinct
keys.  HyperLogLog, a streaming cardinality estimator, is included in
this commit and used to make that determination for text.

Peter Geoghegan, reviewed by me.
2015-01-19 15:28:27 -05:00
..
binaryheap.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
hyperloglog.h Use abbreviated keys for faster sorting of text datums. 2015-01-19 15:28:27 -05:00
ilist.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
pairingheap.h Advance backend's advertised xmin more aggressively. 2015-01-17 01:15:23 +02:00
rbtree.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
stringinfo.h Update copyright for 2015 2015-01-06 11:43:47 -05:00