postgresql/src/backend/access
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
..
brin BRIN typo fix. 2015-01-19 08:34:29 -05:00
common Update copyright for 2015 2015-01-06 11:43:47 -05:00
gin Update copyright for 2015 2015-01-06 11:43:47 -05:00
gist Update copyright for 2015 2015-01-06 11:43:47 -05:00
hash Update copyright for 2015 2015-01-06 11:43:47 -05:00
heap Update copyright for 2015 2015-01-06 11:43:47 -05:00
index Update copyright for 2015 2015-01-06 11:43:47 -05:00
nbtree Use abbreviated keys for faster sorting of text datums. 2015-01-19 15:28:27 -05:00
rmgrdesc Tweak heapam's rmgr desc output slightly 2015-01-12 16:09:16 -03:00
spgist Update copyright for 2015 2015-01-06 11:43:47 -05:00
transam Fix thinko in re-setting wal_log_hints flag from a parameter-change record. 2015-01-15 20:52:41 +02:00
Makefile BRIN: Block Range Indexes 2014-11-07 16:38:14 -03:00