summaryrefslogtreecommitdiff
path: root/src/backend/statistics
diff options
context:
space:
mode:
authorMichael Paquier2021-09-27 05:21:28 +0000
committerMichael Paquier2021-09-27 05:21:28 +0000
commite767ddcd354b51fc4c12d6b02e268861bd871fbc (patch)
tree1a0be8e35ff2bf23da6979377688d7e5eda3f9d4 /src/backend/statistics
parent895267a3266484440c0b2f42f613bcff28844cc1 (diff)
Fix typos and grammar in code comments
Several mistakes have piled in the code comments over the time, including incorrect grammar, function names and simple typos. This commit takes care of a portion of these. No backpatch is done as this is only cosmetic. Author: Justin Pryzby Discussion: https://postgr.es/m/20210924215827.GS831@telsasoft.com
Diffstat (limited to 'src/backend/statistics')
-rw-r--r--src/backend/statistics/README6
-rw-r--r--src/backend/statistics/README.mcv8
-rw-r--r--src/backend/statistics/extended_stats.c8
3 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/statistics/README b/src/backend/statistics/README
index 7fda13e75b..13a97a3566 100644
--- a/src/backend/statistics/README
+++ b/src/backend/statistics/README
@@ -12,7 +12,7 @@ hopefully improving the estimates and producing better plans.
Types of statistics
-------------------
-There are currently two kinds of extended statistics:
+There are currently several kinds of extended statistics:
(a) ndistinct coefficients
@@ -73,8 +73,8 @@ it will do if:
When the above conditions are met, clauselist_selectivity() first attempts to
pass the clause list off to the extended statistics selectivity estimation
-function. This functions may not find any clauses which is can perform any
-estimations on. In such cases these clauses are simply ignored. When actual
+function. This function may not find any clauses which it can perform any
+estimations on. In such cases, these clauses are simply ignored. When actual
estimation work is performed in these functions they're expected to mark which
clauses they've performed estimations for so that any other function
performing estimations knows which clauses are to be skipped.
diff --git a/src/backend/statistics/README.mcv b/src/backend/statistics/README.mcv
index 8455b0d13f..a918fb5634 100644
--- a/src/backend/statistics/README.mcv
+++ b/src/backend/statistics/README.mcv
@@ -2,7 +2,7 @@ MCV lists
=========
Multivariate MCV (most-common values) lists are a straightforward extension of
-regular MCV list, tracking most frequent combinations of values for a group of
+regular MCV lists, tracking most frequent combinations of values for a group of
attributes.
This works particularly well for columns with a small number of distinct values,
@@ -18,7 +18,7 @@ Estimates of some clauses (e.g. equality) based on MCV lists are more accurate
than when using histograms.
Also, MCV lists don't necessarily require sorting of the values (the fact that
-we use sorting when building them is implementation detail), but even more
+we use sorting when building them is an implementation detail), but even more
importantly the ordering is not built into the approximation (while histograms
are built on ordering). So MCV lists work well even for attributes where the
ordering of the data type is disconnected from the meaning of the data. For
@@ -53,7 +53,7 @@ Hashed MCV (not yet implemented)
Regular MCV lists have to include actual values for each item, so if those items
are large the list may be quite large. This is especially true for multivariate
MCV lists, although the current implementation partially mitigates this by
-performing de-duplicating the values before storing them on disk.
+de-duplicating the values before storing them on disk.
It's possible to only store hashes (32-bit values) instead of the actual values,
significantly reducing the space requirements. Obviously, this would only make
@@ -77,7 +77,7 @@ to select the columns from pg_stats. The data is encoded as anyarrays, and
all the items have the same data type, so anyarray provides a simple way to
get a text representation.
-With multivariate MCV lists the columns may use different data types, making
+With multivariate MCV lists, the columns may use different data types, making
it impossible to use anyarrays. It might be possible to produce a similar
array-like representation, but that would complicate further processing and
analysis of the MCV list.
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index 5fa36e0036..4c35223457 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -699,11 +699,11 @@ examine_expression(Node *expr, int stattarget)
}
/*
- * Using 'vacatts' of size 'nvacatts' as input data, return a newly built
+ * Using 'vacatts' of size 'nvacatts' as input data, return a newly-built
* VacAttrStats array which includes only the items corresponding to
- * attributes indicated by 'stxkeys'. If we don't have all of the per column
- * stats available to compute the extended stats, then we return NULL to indicate
- * to the caller that the stats should not be built.
+ * attributes indicated by 'attrs'. If we don't have all of the per-column
+ * stats available to compute the extended stats, then we return NULL to
+ * indicate to the caller that the stats should not be built.
*/
static VacAttrStats **
lookup_var_attr_stats(Relation rel, Bitmapset *attrs, List *exprs,