Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))
Date: 2022-09-05 11:20:31
Message-ID: 20220905112031.GF31833@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 26, 2022 at 03:38:53PM -0700, David G. Johnston wrote:
> On Mon, Jan 24, 2022 at 9:54 AM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:

> > > Unfortunately, "COSTS OFF" breaks postgres_fdw remote_estimate. If specifying
> > > "COSTS ON" in postgres_fdw.c is considered to be a poor fix , then I suppose
> > > this patch series could do as suggested and enable buffers by default only when
> > > ANALYZE is specified. Then postgres_fdw is not affected, and the
> > > explain_regress GUC is optional: instead, we'd need to specify BUFFERS OFF in
> > > ~100 regression tests which use EXPLAIN ANALYZE.
>
> I'm not following the transition from the prior sentences about COSTS to
> this one regarding BUFFERS.

In this patch, SET explain_regress=on changes to defaults to
explain(COSTS OFF), so postgres_fdw now explicitly uses COSTS ON. The
patch also changes default to (BUFFERS OFF), which is what allows
enabling buffers by default. I think I was just saying that the
enabling buffers by default depends on somehow disabling it in
regression tests (preferably not by adding 100 instances of "BUFFERS
OFF").

> The following change in the machine commit seems out-of-place; are we
> fixing a bug here?
>
> explain.c:
> /* Show buffer usage in planning */
> - if (bufusage)
> + if (bufusage && es->buffers)

I think that was an extraneous change, maybe from a conflict while
re-ordering the patches. Removed it and rebased. Thanks for looking.

--
Justin

Attachment Content-Type Size
0001-Add-GUC-explain_regress.patch text/x-diff 9.3 KB
0002-exercise-explain_regress.patch text/x-diff 12.8 KB
0003-Make-explain-default-to-BUFFERS-TRUE.patch text/x-diff 4.8 KB
0004-Add-explain-MACHINE-to-hide-machine-dependent-output.patch text/x-diff 37.1 KB
0005-Rows-removed-by-filter.patch text/x-diff 19.1 KB
0006-Workers-Launched.patch text/x-diff 13.9 KB
0007-parallel-rows.patch text/x-diff 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-09-05 11:50:55 Re: Mingw task for Cirrus CI
Previous Message Andrey Lepikhov 2022-09-05 10:54:58 Re: [POC] Allow flattening of subquery with a link to upper query