From: Justin Pryzby Date: Sun, 22 Nov 2020 19:02:36 -0600 Subject: [PATCH 5/7] Small language fixen --- doc/src/sgml/ref/create_statistics.sgml | 22 +++++++++++----------- src/backend/statistics/extended_stats.c | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/src/sgml/ref/create_statistics.sgml b/doc/src/sgml/ref/create_statistics.sgml index f4a75b3c8e..b4721da583 100644 --- a/doc/src/sgml/ref/create_statistics.sgml +++ b/doc/src/sgml/ref/create_statistics.sgml @@ -141,10 +141,10 @@ CREATE STATISTICS [ IF NOT EXISTS ] statistics_na - Creating expressions statistics is allowed only when there actually are - any expression. Expression statistics are per-expression and are very - similar to creating index on the expression, except that it eliminates - the index maintenance overhead. + Creating expression statistics is allowed only when expressions are given. + Expression statistics are per-expression and are + similar to creating an index on the expression, except that they avoid + the overhead of the index. @@ -156,13 +156,13 @@ CREATE STATISTICS [ IF NOT EXISTS ] statistics_na - All functions and operators used in an statistics definition must be + All functions and operators used in a statistics definition must be immutable, that is, their results must depend only on - their arguments and never on any outside influence (such as + their arguments and never on any external factors (such as the contents of another table or the current time). This restriction ensures that the behavior of the statistics is well-defined. To use a user-defined function in a statistics expression, remember to mark - the function immutable when you create it. + the function immutable. @@ -171,8 +171,8 @@ CREATE STATISTICS [ IF NOT EXISTS ] statistics_na Create table t1 with two functionally dependent columns, i.e., - knowledge of a value in the first column is sufficient for determining the - value in the other column. Then functional dependency statistics are built + knowledge of the value of the first column fully defines the + value of the other column. Then functional dependency statistics are built on those columns: @@ -238,8 +238,8 @@ EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 2); Create table t3 with a single timestamp column, and run a query using an expression on that column. - knowledge of a value in the first column is sufficient for determining the - value in the other column. Then functional dependency statistics are built + Knowledge of the value of the first column fully defines the + value of the other column. Then functional dependency statistics are built on those columns: diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index c6072311bf..aa95e0939a 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -2756,7 +2756,7 @@ evaluate_expressions(Relation rel, List *exprs, int numrows, HeapTuple *rows) len += MAXALIGN(sizeof(Datum *) * nexprs); len += nexprs * MAXALIGN(sizeof(Datum) * numrows); - /* values */ + /* nulls */ len += MAXALIGN(sizeof(bool *) * nexprs); len += nexprs * MAXALIGN(sizeof(bool) * numrows); @@ -2877,7 +2877,7 @@ evaluate_expressions(Relation rel, List *exprs, int numrows, HeapTuple *rows) * * Treat the expressions as attributes with attnums above the regular * attnum range. This will allow us to handle everything in the same - * way, and identify exressions in the dependencies. + * way, and identify expressions in the dependencies. * * XXX This always creates a copy of the bitmap. We might optimize this * by only creating the copy with (nexprs > 0) but then we'd have to track -- 2.17.0 --fUYQa+Pmc3FrFX/N Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0006-Some-cleanup.patch"