Fix example in partitioning documentation

Started by Amit Langoteover 6 years ago5 messages
#1Amit Langote
amitlangote09@gmail.com
1 attachment(s)

Hi,

As of v12, Append node is elided when there's a single subnode under
it. An example in the partitioning documentation needs to be fixed to
account for that change. Attached a patch.

Thanks,
Amit

Attachments:

doc-partitioning.patchapplication/octet-stream; name=doc-partitioning.patchDownload
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index b2bab81840..d7158c1b03 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -4525,9 +4525,8 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2008-01-01';
                                     QUERY PLAN
 -----------------------------------------------------------------------------------
  Aggregate  (cost=37.75..37.76 rows=1 width=8)
-   ->  Append  (cost=0.00..36.21 rows=617 width=0)
-         ->  Seq Scan on measurement_y2008m01  (cost=0.00..33.12 rows=617 width=0)
-               Filter: (logdate >= '2008-01-01'::date)
+   ->  Seq Scan on measurement_y2008m01  (cost=0.00..33.12 rows=617 width=0)
+         Filter: (logdate >= '2008-01-01'::date)
 </programlisting>
    </para>
 
#2Michael Paquier
michael@paquier.xyz
In reply to: Amit Langote (#1)
Re: Fix example in partitioning documentation

On Tue, Sep 24, 2019 at 10:52:30AM +0900, Amit Langote wrote:

As of v12, Append node is elided when there's a single subnode under
it. An example in the partitioning documentation needs to be fixed to
account for that change. Attached a patch.

Indeed, using the same example as the docs:
CREATE TABLE measurement (
logdate date not null,
peaktemp int,
unitsales int
) PARTITION BY RANGE (logdate);
CREATE TABLE measurement_y2016m07
PARTITION OF measurement (
unitsales DEFAULT 0
) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01');
SET enable_partition_pruning = on;
EXPLAIN SELECT count(*) FROM measurement WHERE logdate = DATE
'2016-07-02';

I'll take care of committing that, however this will have to wait
until v12 RC1 is tagged.
--
Michael

#3Amit Langote
amitlangote09@gmail.com
In reply to: Michael Paquier (#2)
Re: Fix example in partitioning documentation

On Tue, Sep 24, 2019 at 11:14 AM Michael Paquier <michael@paquier.xyz> wrote:

On Tue, Sep 24, 2019 at 10:52:30AM +0900, Amit Langote wrote:

As of v12, Append node is elided when there's a single subnode under
it. An example in the partitioning documentation needs to be fixed to
account for that change. Attached a patch.

Indeed, using the same example as the docs:
CREATE TABLE measurement (
logdate date not null,
peaktemp int,
unitsales int
) PARTITION BY RANGE (logdate);
CREATE TABLE measurement_y2016m07
PARTITION OF measurement (
unitsales DEFAULT 0
) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01');
SET enable_partition_pruning = on;
EXPLAIN SELECT count(*) FROM measurement WHERE logdate = DATE
'2016-07-02';

I'll take care of committing that, however this will have to wait
until v12 RC1 is tagged.

Sure, thank you.

Regards,
Amit

#4Michael Paquier
michael@paquier.xyz
In reply to: Amit Langote (#3)
Re: Fix example in partitioning documentation

On Tue, Sep 24, 2019 at 11:36:40AM +0900, Amit Langote wrote:

Sure, thank you.

And done with f5daf7f, back-patched down to 12.
--
Michael

#5Amit Langote
amitlangote09@gmail.com
In reply to: Michael Paquier (#4)
Re: Fix example in partitioning documentation

On Wed, Sep 25, 2019 at 1:47 PM Michael Paquier <michael@paquier.xyz> wrote:

On Tue, Sep 24, 2019 at 11:36:40AM +0900, Amit Langote wrote:

Sure, thank you.

And done with f5daf7f, back-patched down to 12.

Thanks again. :)

Regards,
Amit