postgresql/src/backend/commands
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
..
Makefile Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
aggregatecmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
alter.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
analyze.c Use abbreviated keys for faster sorting of text datums. 2015-01-19 15:28:27 -05:00
async.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
cluster.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
collationcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
comment.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
constraint.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
conversioncmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
copy.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
createas.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
dbcommands.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
define.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
discard.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
dropcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
event_trigger.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
explain.c Show sort ordering options in EXPLAIN output. 2015-01-16 18:19:00 -05:00
extension.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
foreigncmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
functioncmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
indexcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
lockcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
matview.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
opclasscmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
operatorcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
policy.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
portalcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
prepare.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
proclang.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
schemacmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
seclabel.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
sequence.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tablecmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tablespace.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
trigger.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsearchcmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
typecmds.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
user.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
vacuum.c Reject ANALYZE commands during VACUUM FULL or another ANALYZE. 2015-01-07 22:33:58 -05:00
vacuumlazy.c Fix logging of pages skipped due to pins during vacuum. 2015-01-08 12:57:09 +01:00
variable.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
view.c Update copyright for 2015 2015-01-06 11:43:47 -05:00