doc phrase: "inheritance child"

Started by Justin Pryzbyover 3 years ago8 messages
#1Justin Pryzby
pryzby@telsasoft.com
1 attachment(s)

In this old sub-thread, we removed the use of word "partition" when it didn't
mean "declarative partitioning".

/messages/by-id/20180601213300.GT5164@telsasoft.com

Now, I'm proposing to get rid of the phrase "inheritance child" when it also
*does* apply to declarative partitioning.

Attachments:

0001-doc-avoid-saying-inheritence-when-it-applies-to-part.patchtext/x-diff; charset=us-asciiDownload
From 499fdd3ab35e6a152ae2cada934dfd7df48e7e10 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 25 Apr 2022 14:59:12 -0500
Subject: [PATCH] doc: avoid saying "inheritence" when it applies to
 partitioned rels

This is almost the opposite of 0c06534bd, which removed references to
"partition" for "child".
---
 doc/src/sgml/catalogs.sgml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index c00c93dd7be..366a142d35e 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -2135,7 +2135,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <structfield>relhassubclass</structfield> <type>bool</type>
       </para>
       <para>
-       True if table or index has (or once had) any inheritance children
+       True if table or index has (or once had) any inheritance children or partitions
       </para></entry>
      </row>
 
@@ -7306,7 +7306,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
   <para>
    Normally there is one entry, with <structfield>stainherit</structfield> =
    <literal>false</literal>, for each table column that has been analyzed.
-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
    <structfield>stainherit</structfield> = <literal>true</literal> is also created.  This row
    represents the column's statistics over the inheritance tree, i.e.,
    statistics for the data you'd see with
@@ -7389,7 +7389,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <structfield>stainherit</structfield> <type>bool</type>
       </para>
       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child tables, not just the
        values in the specified relation
       </para></entry>
      </row>
@@ -7661,7 +7661,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
   <para>
    Normally there is one entry, with <structfield>stxdinherit</structfield> =
    <literal>false</literal>, for each statistics object that has been analyzed.
-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
    <structfield>stxdinherit</structfield> = <literal>true</literal> is also created.
    This row represents the statistics object over the inheritance tree, i.e.,
    statistics for the data you'd see with
@@ -7715,7 +7715,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <structfield>stxdinherit</structfield> <type>bool</type>
       </para>
       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child childs, not just the
        values in the specified relation
       </para></entry>
      </row>
@@ -13152,7 +13152,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
        <structfield>inherited</structfield> <type>bool</type>
       </para>
       <para>
-       If true, this row includes inheritance child columns, not just the
+       If true, this row includes child tables, not just the
        values in the specified table
       </para></entry>
      </row>
-- 
2.17.1

#2Ashutosh Bapat
ashutosh.bapat@enterprisedb.com
In reply to: Justin Pryzby (#1)
Re: doc phrase: "inheritance child"

Hi Justin,

@@ -7306,7 +7306,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration
count&gt;</replaceable>:<replaceable>&l
   <para>
    Normally there is one entry, with <structfield>stainherit</structfield>
=
    <literal>false</literal>, for each table column that has been analyzed.
-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
    <structfield>stainherit</structfield> = <literal>true</literal> is also
created.  This row
    represents the column's statistics over the inheritance tree, i.e.,
    statistics for the data you'd see with

For partitioned tables only the second entry makes sense. IIRC, we had done
some work to remove the first entry. Can you please check whether a
partitioned table also has two entries?

       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child tables, not just the

We are replacing columns with tables; is that intentional?

Partitioned tables do not have their own stats, it's just aggregated
partition stats.

-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
    <structfield>stxdinherit</structfield> = <literal>true</literal> is
also created.
    This row represents the statistics object over the inheritance tree,
i.e.,

Similar to the first comment. s/inheritance tree/inheritance or partition
tree/ ?

-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child childs, not just the
        values in the specified relation
       </para></entry>
      </row>
@@ -13152,7 +13152,7 @@ SELECT * FROM pg_locks pl LEFT JOIN
pg_prepared_xacts ppx
        <structfield>inherited</structfield> <type>bool</type>
       </para>
       <para>
-       If true, this row includes inheritance child columns, not just the
+       If true, this row includes child tables, not just the
        values in the specified table
       </para></entry>
      </row>

Replacing inheritance child "column" with "tables", is that intentional?

Are these all the places where child/children need to be replaced by
partitions?

Now that the feature is old and also being used widely, it probably makes
sense to mention partition where inheritance children is mentioned, if this
double mention makes sense. But I think it's more than just the
replacement. We need to rewrite or make modified copies of some of the
sentences or paragraphs entirely. Esp. the things that apply to inheritance
may not be applicable as is to partitioning and vice versa. We may be
required to replace inheritance tree with partition tree in the nearby
sentences.

--
Best Wishes,
Ashutosh

#3Amit Langote
amitlangote09@gmail.com
In reply to: Ashutosh Bapat (#2)
Re: doc phrase: "inheritance child"

Hi,

On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:

@@ -7306,7 +7306,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
<para>
Normally there is one entry, with <structfield>stainherit</structfield> =
<literal>false</literal>, for each table column that has been analyzed.
-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
<structfield>stainherit</structfield> = <literal>true</literal> is also created.  This row
represents the column's statistics over the inheritance tree, i.e.,
statistics for the data you'd see with

For partitioned tables only the second entry makes sense. IIRC, we had done some work to remove the first entry. Can you please check whether a partitioned table also has two entries?

Don't think we've made any changes yet that get rid of the parent
partitioned table's entry in pg_statistic:

create table foo (a int) partition by list (a);
create table foo1 partition of foo for values in (1);
analyze foo;
select starelid::regclass, stainherit from pg_statistic where
starelid::regclass in (select relid from pg_partition_tree('foo'));
starelid | stainherit
----------+------------
foo | t
foo1 | f
(2 rows)

Maybe you're thinking of RangeTblEntry that the planner makes 2 copies
for inheritance parents, but only 1 for partition parents as of
e8d5dd6be79.

--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com

#4Amit Langote
amitlangote09@gmail.com
In reply to: Ashutosh Bapat (#2)
Re: doc phrase: "inheritance child"

On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:

<para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child tables, not just the

We are replacing columns with tables; is that intentional?

Partitioned tables do not have their own stats, it's just aggregated partition stats.
...
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child childs, not just the
values in the specified relation
</para></entry>
</row>
@@ -13152,7 +13152,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
<structfield>inherited</structfield> <type>bool</type>
</para>
<para>
-       If true, this row includes inheritance child columns, not just the
+       If true, this row includes child tables, not just the
values in the specified table
</para></entry>
</row>

Replacing inheritance child "column" with "tables", is that intentional?

I was a bit confused by these too, though perhaps the original text is
not as clear as it could be? Would the following be a good rewrite:

If true, the stats cover the contents not only of the specified table,
but also of its child tables or partitions. (If the table is
partitioned, which contains no data by itself, the stats only cover
the contents of partitions).

Although, maybe the parenthetical is unnecessary.

--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com

#5Justin Pryzby
pryzby@telsasoft.com
In reply to: Amit Langote (#4)
1 attachment(s)
Re: doc phrase: "inheritance child"

On Fri, May 27, 2022 at 03:22:38PM +0900, Amit Langote wrote:

On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote:

<para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child tables, not just the

We are replacing columns with tables; is that intentional?

Partitioned tables do not have their own stats, it's just aggregated partition stats.
...
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child childs, not just the
values in the specified relation
</para></entry>
</row>
@@ -13152,7 +13152,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
<structfield>inherited</structfield> <type>bool</type>
</para>
<para>
-       If true, this row includes inheritance child columns, not just the
+       If true, this row includes child tables, not just the
values in the specified table
</para></entry>
</row>

Replacing inheritance child "column" with "tables", is that intentional?

I was a bit confused by these too, though perhaps the original text is
not as clear as it could be? Would the following be a good rewrite:

I updated the language to say "values from". Is this better ?

And rebased to include changes to 401f623c7.

BTW nobody complained about my "child child" typo.

--
Justin

Attachments:

0001-doc-avoid-saying-inheritence-when-it-applies-to-part.patchtext/x-diff; charset=us-asciiDownload
From ee0b60ba9c5d08aff49600866d7e8439d836579a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 25 Apr 2022 14:59:12 -0500
Subject: [PATCH] doc: avoid saying "inheritence" when it applies to
 partitioned rels

This is almost the opposite of 0c06534bd, which removed references to
"partition" in favour of "child".
---
 doc/src/sgml/catalogs.sgml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 2e46ed7cc57..851ff959021 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -2140,7 +2140,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <structfield>relhassubclass</structfield> <type>bool</type>
       </para>
       <para>
-       True if table or index has (or once had) any inheritance children
+       True if table or index has (or once had) any inheritance children or partitions
       </para></entry>
      </row>
 
@@ -7311,7 +7311,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
   <para>
    Normally there is one entry, with <structfield>stainherit</structfield> =
    <literal>false</literal>, for each table column that has been analyzed.
-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
    <structfield>stainherit</structfield> = <literal>true</literal> is also created.  This row
    represents the column's statistics over the inheritance tree, i.e.,
    statistics for the data you'd see with
@@ -7394,7 +7394,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <structfield>stainherit</structfield> <type>bool</type>
       </para>
       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include values from child tables, not just the
        values in the specified relation
       </para></entry>
      </row>
@@ -7666,7 +7666,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
   <para>
    Normally there is one entry, with <structfield>stxdinherit</structfield> =
    <literal>false</literal>, for each statistics object that has been analyzed.
-   If the table has inheritance children, a second entry with
+   If the table has inheritance children or partitions, a second entry with
    <structfield>stxdinherit</structfield> = <literal>true</literal> is also created.
    This row represents the statistics object over the inheritance tree, i.e.,
    statistics for the data you'd see with
@@ -7720,7 +7720,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <structfield>stxdinherit</structfield> <type>bool</type>
       </para>
       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include values from child tables, not just the
        values in the specified relation
       </para></entry>
      </row>
@@ -13157,7 +13157,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
        <structfield>inherited</structfield> <type>bool</type>
       </para>
       <para>
-       If true, this row includes inheritance child columns, not just the
+       If true, this row includes values from child tables, not just the
        values in the specified table
       </para></entry>
      </row>
@@ -13419,7 +13419,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
        (references <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>.<structfield>stxdinherit</structfield>)
       </para>
       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include values from child tables, not just the
        values in the specified relation
       </para></entry>
      </row>
@@ -13611,7 +13611,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
        (references <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>.<structfield>stxdinherit</structfield>)
       </para>
       <para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include values from child tables, not just the
        values in the specified relation
       </para></entry>
      </row>
-- 
2.17.1

#6Amit Langote
amitlangote09@gmail.com
In reply to: Justin Pryzby (#5)
Re: doc phrase: "inheritance child"

On Thu, Jun 30, 2022 at 6:55 PM Justin Pryzby <pryzby@telsasoft.com> wrote:

On Fri, May 27, 2022 at 03:22:38PM +0900, Amit Langote wrote:

On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote:

<para>
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child tables, not just the

We are replacing columns with tables; is that intentional?

Partitioned tables do not have their own stats, it's just aggregated partition stats.
...
-       If true, the stats include inheritance child columns, not just the
+       If true, the stats include child childs, not just the
values in the specified relation
</para></entry>
</row>
@@ -13152,7 +13152,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
<structfield>inherited</structfield> <type>bool</type>
</para>
<para>
-       If true, this row includes inheritance child columns, not just the
+       If true, this row includes child tables, not just the
values in the specified table
</para></entry>
</row>

Replacing inheritance child "column" with "tables", is that intentional?

I was a bit confused by these too, though perhaps the original text is
not as clear as it could be? Would the following be a good rewrite:

I updated the language to say "values from". Is this better ?

Yes.

--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com

#7Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Justin Pryzby (#5)
Re: doc phrase: "inheritance child"

On 2022-Jun-30, Justin Pryzby wrote:

I updated the language to say "values from". Is this better ?

And rebased to include changes to 401f623c7.

Applied to 15 and master, thanks.

BTW nobody complained about my "child child" typo.

:-(

BTW I didn't notice your annotation in the CF app until I had already
pushed it and went there to update the status.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Maybe there's lots of data loss but the records of data loss are also lost.
(Lincoln Yeoh)

#8Justin Pryzby
pryzby@telsasoft.com
In reply to: Alvaro Herrera (#7)
Re: doc phrase: "inheritance child"

On Thu, Jul 28, 2022 at 06:30:26PM +0200, Alvaro Herrera wrote:

BTW I didn't notice your annotation in the CF app until I had already
pushed it and went there to update the status.

Hmmm and I didn't see that you'd updated the status ... so done.
Thanks for rebasifying it.

--
Justin