summaryrefslogtreecommitdiff
path: root/src/include/pg_config_manual.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-01-19 15:20:31 -0500
committerRobert Haas <rhaas@postgresql.org>2015-01-19 15:28:27 -0500
commit4ea51cdfe85ceef8afabceb03c446574daa0ac23 (patch)
tree703433dfca58c84f8b947b6f4f562ecdf98f1669 /src/include/pg_config_manual.h
parent1605291b6c14be92915948d17f5509191632c97f (diff)
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.
Diffstat (limited to 'src/include/pg_config_manual.h')
-rw-r--r--src/include/pg_config_manual.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index cb35697ad07..5cfc0ae1e80 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -214,13 +214,13 @@
#endif
/*
- * Assumed cache line size. This doesn't affect correctness, but can be
- * used for low-level optimizations. Currently, this is only used to pad
- * some data structures in xlog.c, to ensure that highly-contended fields
- * are on different cache lines. Too small a value can hurt performance due
- * to false sharing, while the only downside of too large a value is a few
- * bytes of wasted memory. The default is 128, which should be large enough
- * for all supported platforms.
+ * Assumed cache line size. This doesn't affect correctness, but can be used
+ * for low-level optimizations. Currently, this is used to pad some data
+ * structures in xlog.c, to ensure that highly-contended fields are on
+ * different cache lines. Too small a value can hurt performance due to false
+ * sharing, while the only downside of too large a value is a few bytes of
+ * wasted memory. The default is 128, which should be large enough for all
+ * supported platforms.
*/
#define PG_CACHE_LINE_SIZE 128