Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mV1K3-0000on-Lo for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Sep 2021 00:50:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mV1Jz-0002DF-FT for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Sep 2021 00:50:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mV1Jz-0002D7-10 for pgsql-hackers@lists.postgresql.org; Tue, 28 Sep 2021 00:50:11 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mV1Jv-0000wV-9a for pgsql-hackers@postgresql.org; Tue, 28 Sep 2021 00:50:09 +0000 Received: by mail-io1-xd33.google.com with SMTP id s20so25175091ioa.4 for ; Mon, 27 Sep 2021 17:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FPhTcAscDE9fh4betZbZaJBRIULFAYNPDhHU80fjpE4=; b=c3ili8Y0J7l8fsjnwUlKEiNOcUd8ulMZQ5eNsqf6bBG2fkLusezCS5IpKo3XSUGuFV NvcrXrJRJerIrsP0/Pol+5ESuNwu0wKsumTwODJvjaJl84t8wjvLs4LSEf8dyt5ACj2c 8d7FKWVQrRn8atGcmqwZ8Dy2a5i4SXfBFgdY3eg02KikWKt+8oe1CNupFboPJGtqVgZ9 OYpyr37XhueNSu6U6Hqxokm2FR6YdzWTCJVS9rVRDE2LxagTioJz0g8FWrMSkf9W+oY3 Og3FYkrJY4HqX5Y/q5uTb/hBBV787g42m1Gqq6lhD37KGbLp6yRjkCuIwm91Lu3DIn4V 1P0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FPhTcAscDE9fh4betZbZaJBRIULFAYNPDhHU80fjpE4=; b=jB/Fv3tHX62iCaFHFjls5lTQX0fho11wWJ0gfHFEPHj9Y3vLunjfFMCYCl/Ye/n8CJ 0t+RBujok691Ql6ALM552CC5/FmylY+wOP3+VXFsy23/i37BWU27A8IsPPfBWhBhOaft fWGjhYz6u/Br+x+kYSkKHHwW5/udUJcPy01NFcG/2qDF82BeEwr8HU5LHaMp8tClSgLc 6Zq7JzmEVPKqTsxdULLS9ZBrlhhzuIt11pyUotAtmnoxhYJvYHvZYDQsyOhJn8taPjbi IKwZkynXyR8CseLXqxCTTQ1UmmM70cChR6+CPGDY7Nqh/b8jmiV91LZllLmvrivcaBsr oFBA== X-Gm-Message-State: AOAM5333785R4+rRYTPq/Wqd8/l1YTCSHOdjBXakU0YXIjxCd2ejiTj+ P7J3n9Q++rrrIsDIZx6g1HXlGA== X-Google-Smtp-Source: ABdhPJzNVvDotsTgfH/LiIGox5Zj8y7y63f4g9ue1HgaQ2X3auk2/phbZ16ta9MM+zYWd8ANL7GdWA== X-Received: by 2002:a6b:5a02:: with SMTP id o2mr1933227iob.58.1632790205365; Mon, 27 Sep 2021 17:50:05 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id c3sm5481683ili.33.2021.09.27.17.50.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Sep 2021 17:50:04 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 7F450800A3C; Mon, 27 Sep 2021 19:50:02 -0500 (CDT) Date: Mon, 27 Sep 2021 19:50:02 -0500 From: Justin Pryzby To: Alvaro Herrera Cc: Michael Paquier , pgsql-hackers@postgresql.org, Tomas Vondra , Andres Freund , Zhihong Yu Subject: Re: typos (and more) Message-ID: <20210928005002.GM831@telsasoft.com> References: <202109272104.7t253iw236fb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WFYXJKyHTUiGqOmp" Content-Disposition: inline In-Reply-To: <202109272104.7t253iw236fb@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --WFYXJKyHTUiGqOmp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 27, 2021 at 06:04:02PM -0300, Alvaro Herrera wrote: > On 2021-Sep-27, Michael Paquier wrote: > > > The use > > of "statistic", "statistics" and "statistics object" in 0008 and 0012 > > is indeed inconsistent. The latter term is the most used, but it > > sounds a bit weird to me even if it refers to the DDL object > > manipulated. Simply using "statistics" would be tempting. > > Initially we just used "statistic" as a noun, which IIRC was already > grammatically wrong (but I didn't know that and I think Tomas didn't > either); later at some point when discussing how to use that noun in > plural we realized this and argued that merely using "statistics" was > even more wrong. It was then that we started using the term "statistics > object" with plural "statistics objects". Going back to using just > "statistics" is unlikely to have become correct; I think Justin's > patches 0008 and 0012 are correct. Attached is an updated patch fixing more of the same. -- Justin --WFYXJKyHTUiGqOmp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Refer-to-plural-statistics-OBJECTS.patch" From 45c16e1cb6b3ddf007806f5942f3acf64a75edf7 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 12 Sep 2021 23:45:05 -0500 Subject: [PATCH] Refer to plural statistics OBJECTS See also: f04c9a61468904b6815b2bc73a48878817766e0e --- src/backend/commands/statscmds.c | 14 +++++++------- src/backend/statistics/extended_stats.c | 12 ++++++------ src/backend/utils/adt/selfuncs.c | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c index 9938b65083..13987d9dcb 100644 --- a/src/backend/commands/statscmds.c +++ b/src/backend/commands/statscmds.c @@ -431,7 +431,7 @@ CreateStatistics(CreateStatsStmt *stmt) * similar to why we don't bother with extracting columns from * expressions. It's either expensive or very easy to defeat for * determined user, and there's no risk if we allow such statistics (the - * statistics is useless, but harmless). + * statistic is useless, but harmless). */ foreach(cell, stxexprs) { @@ -560,7 +560,7 @@ CreateStatistics(CreateStatsStmt *stmt) } /* - * If there are no dependencies on a column, give the statistics an auto + * If there are no dependencies on a column, give the statistics object an auto * dependency on the whole table. In most cases, this will be redundant, * but it might not be if the statistics expressions contain no Vars * (which might seem strange but possible). This is consistent with what @@ -649,7 +649,7 @@ AlterStatistics(AlterStatsStmt *stmt) stxoid = get_statistics_object_oid(stmt->defnames, stmt->missing_ok); /* - * If we got here and the OID is not valid, it means the statistics does + * If we got here and the OID is not valid, it means the statistics object does * not exist, but the command specified IF EXISTS. So report this as a * simple NOTICE and we're done. */ @@ -768,7 +768,7 @@ RemoveStatisticsById(Oid statsOid) } /* - * Select a nonconflicting name for a new statistics. + * Select a nonconflicting name for a new statistics object. * * name1, name2, and label are used the same way as for makeObjectName(), * except that the label can't be NULL; digits will be appended to the label @@ -815,7 +815,7 @@ ChooseExtendedStatisticName(const char *name1, const char *name2, } /* - * Generate "name2" for a new statistics given the list of column names for it + * Generate "name2" for a new statistics object given the list of column names for it * This will be passed to ChooseExtendedStatisticName along with the parent * table name and a suitable label. * @@ -869,8 +869,8 @@ ChooseExtendedStatisticNameAddition(List *exprs) } /* - * StatisticsGetRelation: given a statistics's relation OID, get the OID of - * the relation it is an statistics on. Uses the system cache. + * StatisticsGetRelation: given a statistics object's OID, get the OID of + * the relation it is defined on. Uses the system cache. */ Oid StatisticsGetRelation(Oid statId, bool missing_ok) diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index 4c35223457..97f4ba3590 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -182,7 +182,7 @@ BuildRelationExtStatistics(Relation onerel, double totalrows, continue; } - /* compute statistics target for this statistics */ + /* compute statistics target for this statistics object */ stattarget = statext_compute_stattarget(stat->stattarget, bms_num_members(stat->columns), stats); @@ -195,7 +195,7 @@ BuildRelationExtStatistics(Relation onerel, double totalrows, if (stattarget == 0) continue; - /* evaluate expressions (if the statistics has any) */ + /* evaluate expressions (if the statistics object has any) */ data = make_build_data(onerel, stat, numrows, rows, stats, stattarget); /* compute statistic of each requested type */ @@ -257,7 +257,7 @@ BuildRelationExtStatistics(Relation onerel, double totalrows, * when analyzing only some of the columns, this will skip statistics objects * that would require additional columns. * - * See statext_compute_stattarget for details about how we compute statistics + * See statext_compute_stattarget for details about how we compute the statistics * target for a statistics object (from the object target, attribute targets * and default statistics target). */ @@ -329,7 +329,7 @@ ComputeExtStatisticsRows(Relation onerel, * * When computing target for extended statistics objects, we consider three * places where the target may be set - the statistics object itself, - * attributes the statistics is defined on, and then the default statistics + * attributes the statistics object is defined on, and then the default statistics * target. * * First we look at what's set for the statistics object itself, using the @@ -1789,8 +1789,8 @@ statext_mcv_clauselist_selectivity(PlannerInfo *root, List *clauses, int varReli /* * The clause was not estimated yet, and we've extracted either - * attnums of expressions from it. Ignore it if it's not fully - * covered by the chosen statistics. + * attnums or expressions from it. Ignore it if it's not fully + * covered by the chosen statistics object. * * We need to check both attributes and expressions, and reject if * either is not covered. diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 0c8c05f6c2..0e5fb83505 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -3443,7 +3443,7 @@ estimate_num_groups(PlannerInfo *root, List *groupExprs, double input_rows, * expression, treat it as a single variable even if it's really more * complicated. * - * XXX This has the consequence that if there's a statistics on the + * XXX This has the consequence that if there's a statistics object on the * expression, we don't split it into individual Vars. This affects * our selection of statistics in estimate_multivariate_ndistinct, * because it's probably better to use more accurate estimate for each @@ -3918,7 +3918,7 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel, if (!rel->statlist) return false; - /* look for the ndistinct statistics matching the most vars */ + /* look for the ndistinct statistics object matching the most vars */ nmatches_vars = 0; /* we require at least two matches */ nmatches_exprs = 0; foreach(lc, rel->statlist) @@ -3964,7 +3964,7 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel, continue; } - /* expression - see if it's in the statistics */ + /* expression - see if it's in the statistics object */ foreach(lc3, info->exprs) { Node *expr = (Node *) lfirst(lc3); @@ -4053,7 +4053,7 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel, if (!AttrNumberIsForUserDefinedAttr(attnum)) continue; - /* Is the variable covered by the statistics? */ + /* Is the variable covered by the statistics object? */ if (!bms_is_member(attnum, matched_info->keys)) continue; @@ -4075,7 +4075,7 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel, if (found) continue; - /* expression - see if it's in the statistics */ + /* expression - see if it's in the statistics object */ idx = 0; foreach(lc3, matched_info->exprs) { @@ -5276,7 +5276,7 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid, /* * For simplicity, we insist on the whole table being * selectable, rather than trying to identify which - * column(s) the statistics depends on. Also require all + * column(s) the statistics object depends on. Also require all * rows to be selectable --- there must be no * securityQuals from security barrier views or RLS * policies. -- 2.17.0 --WFYXJKyHTUiGqOmp--