[PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

Started by Matsumura, Ryo9 months ago8 messageshackers
Jump to latest
#1Matsumura, Ryo
matsumura.ryo@fujitsu.com

Hi Hackers,

It looks like the EXPLAIN documentation is missing an explanation of the default values for the BUFFERS and SERIALIZE options.
I've attached a patch that adds this information.
While the documentation currently notes that these options are implicitly enabled when ANALYZE is specified, the default values of the parameters themselves do not appear to be documented.

Best Regards
Ryo Matsumura

Attachments:

v1-0001-Docs-clarify-default-values-in-EXPLAIN-documentat.patchapplication/octet-stream; name=v1-0001-Docs-clarify-default-values-in-EXPLAIN-documentat.patchDownload+2-1
#2Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#1)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Fri, Mar 13, 2026 at 5:38 PM Ryo Matsumura (Fujitsu)
<matsumura.ryo@fujitsu.com> wrote:

Hi Hackers,

It looks like the EXPLAIN documentation is missing an explanation of the default values for the BUFFERS and SERIALIZE options.
I've attached a patch that adds this information.
While the documentation currently notes that these options are implicitly enabled when ANALYZE is specified, the default values of the parameters themselves do not appear to be documented.

+1 to adding a description of the default value.

format, only non-zero values are printed. Buffers information is
automatically included when <literal>ANALYZE</literal> is used.
+ It defaults to <literal>FALSE</literal>.

How about clarifying the default depending on whether ANALYZE is used?
For example:

When ANALYZE is used, this parameter defaults to TRUE and buffer usage
information is included. Otherwise, it defaults to FALSE.

argument, <literal>TEXT</literal> is assumed.
+ It defaults to <literal>FALSE</literal>.

Does SERIALIZE actually accept FALSE?

Regards,

--
Fujii Masao

#3Matsumura, Ryo
matsumura.ryo@fujitsu.com
In reply to: Fujii Masao (#2)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Fri, Mar 13, 2026 at 14:38 UTC, Fujii Masao <masao.fujii@gmail.com> wrote:

When ANALYZE is used, this parameter defaults to TRUE and buffer usage
information is included. Otherwise, it defaults to FALSE.

Thanks for the comment. I hadn’t understood the implementation correctly.
It might also be worth clarifying that even when the BUFFERS(and WAL) is set to TRUE,
values are shown only when there is something to report as follows:

BUFFERS
       The number of blocks shown for an
       upper-level node includes those used by all its child nodes.  In text
-      format, only non-zero values are printed.  Buffers information is
-      automatically included when <literal>ANALYZE</literal> is used.
+      format, only non-zero values are printed.
+      When ANALYZE is used, this parameter defaults to <literal>TRUE</literal>
+      and buffer usage information is included.
+      Otherwise, it defaults to <literal>FALSE</literal>.
+      When the <literal>FORMAT</literal> is <literal>TEXT</literal>,
+      no output is produced unless there is something to report, even if it
+      is set to <literal>TRUE</literal>.
WAL
       In text format, only non-zero values are printed.
       This parameter may only be used when <literal>ANALYZE</literal> is also
       enabled.  It defaults to <literal>FALSE</literal>.
+      When the <literal>FORMAT</literal> is <literal>TEXT</literal>,
+      no output is produced unless there is something to report, even if it
+      is set to <literal>TRUE</literal>.

Does SERIALIZE actually accept FALSE?

This was entirely my mistake. And the default value was already documented.

Best Regards
Ryo Matsumura

Attachments:

v2-0001-Docs-clarify-default-values-in-EXPLAIN-documentat.patchapplication/octet-stream; name=v2-0001-Docs-clarify-default-values-in-EXPLAIN-documentat.patchDownload+10-3
#4Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#3)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Mon, Mar 16, 2026 at 6:37 PM Ryo Matsumura (Fujitsu)
<matsumura.ryo@fujitsu.com> wrote:

On Fri, Mar 13, 2026 at 14:38 UTC, Fujii Masao <masao.fujii@gmail.com> wrote:

When ANALYZE is used, this parameter defaults to TRUE and buffer usage
information is included. Otherwise, it defaults to FALSE.

Thanks for the comment. I hadn’t understood the implementation correctly.
It might also be worth clarifying that even when the BUFFERS(and WAL) is set to TRUE,
values are shown only when there is something to report as follows:

Isn't the existing description "In text format, only non-zero values
are printed." sufficient?

Regards,

--
Fujii Masao

#5Matsumura, Ryo
matsumura.ryo@fujitsu.com
In reply to: Fujii Masao (#4)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Mon, Mar 16, 2026 at 10:30:00 +0000, Fujii Masao <masao.fujii@gmail.com> wrote:

Isn't the existing description "In text format, only non-zero values
are printed." sufficient?

This description is sufficient. It was a careless mistake on my part. Sorry about that.

I’ve attached a revised patch.

Best Regards
Ryo Matsumura

Attachments:

v3-0001-Docs-clarify-default-values-in-EXPLAIN-documentat.patchapplication/octet-stream; name=v3-0001-Docs-clarify-default-values-in-EXPLAIN-documentat.patchDownload+4-3
#6Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#5)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Tue, Mar 17, 2026 at 7:26 PM Matsumura, Ryo/松村 量
<matsumura.ryo@fujitsu.com> wrote:

On Mon, Mar 16, 2026 at 10:30:00 +0000, Fujii Masao <masao.fujii@gmail.com> wrote:

Isn't the existing description "In text format, only non-zero values
are printed." sufficient?

This description is sufficient. It was a careless mistake on my part. Sorry about that.

I’ve attached a revised patch.

Thanks for updating the patch!

Since the docs already state that buffer usage is automatically included
when ANALYZE is used, the focus here seems to be clarifying the behavior
of BUFFERS without ANALYZE. From that perspective, it might be better to
explicitly describe what happens when BUFFERS is TRUE without ANALYZE.

I've updated the patch accordingly. Patch attached. Thought?

Regards,

--
Fujii Masao

Attachments:

v4-0001-doc-Clarify-BUFFERS-behavior-without-ANALYZE-in-E.patchapplication/octet-stream; name=v4-0001-doc-Clarify-BUFFERS-behavior-without-ANALYZE-in-E.patchDownload+4-2
#7Matsumura, Ryo
matsumura.ryo@fujitsu.com
In reply to: Fujii Masao (#6)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Tue, Mar 17, 2026 at 15:34:00 +0000, Fujii Masao <masao.fujii@gmail.com> wrote:

Since the docs already state that buffer usage is automatically included
when ANALYZE is used, the focus here seems to be clarifying the behavior
of BUFFERS without ANALYZE. From that perspective, it might be better to
explicitly describe what happens when BUFFERS is TRUE without ANALYZE.
I've updated the patch accordingly. Patch attached. Thought?

I have no objections. Sorry for my shallow understanding.

Best Regards
Ryo Matsumura

#8Fujii Masao
masao.fujii@gmail.com
In reply to: Matsumura, Ryo (#7)
Re: [PATCH] Docs: clarify default values of EXPLAIN BUFFERS and SERIALIZE

On Wed, Mar 18, 2026 at 7:09 PM Ryo Matsumura (Fujitsu)
<matsumura.ryo@fujitsu.com> wrote:

On Tue, Mar 17, 2026 at 15:34:00 +0000, Fujii Masao <masao.fujii@gmail.com> wrote:

Since the docs already state that buffer usage is automatically included
when ANALYZE is used, the focus here seems to be clarifying the behavior
of BUFFERS without ANALYZE. From that perspective, it might be better to
explicitly describe what happens when BUFFERS is TRUE without ANALYZE.
I've updated the patch accordingly. Patch attached. Thought?

I have no objections.

I've pushed the patch. Thanks!

Regards,

--
Fujii Masao