pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Cc: pgsql-hackers@lists.postgresql.org, Chantal Keller <chantal.keller@universite-paris-saclay.fr>
Subject: Re: Improving EXPLAIN's display of SubPlan nodes
Date: Tue, 19 Mar 2024 17:40:16 -0400
Message-ID: <4021298.1710884416@sss.pgh.pa.us> (raw )
In-Reply-To: <CAEZATCXiwEyedNkcNOH+U7ejMn0LkUyFSHoLGGtu=bVQKDGDQA@mail.gmail.com >
References: <2838538.1705692747@sss.pgh.pa.us >
<CAJ7c6TMApZ62NOOk73_BmKkKtdhV+i=tyvXR52DAB-YVuFANDA@mail.gmail.com >
<3791430.1705943243@sss.pgh.pa.us >
<3831858.1705959108@sss.pgh.pa.us >
<3511300.1708112330@sss.pgh.pa.us >
<CAEZATCUQB3ybgBxEHXq28ihMS3+Bq-Gy8RraJpKGmVpjES6E3A@mail.gmail.com >
<2506269.1710514705@sss.pgh.pa.us >
<2982030.1710609907@sss.pgh.pa.us >
<CAEZATCVa63moqwsi37a6LKj9mDsnbzEUw0KJYT8Qe2OZ-7V+Jg@mail.gmail.com >
<3127158.1710685722@sss.pgh.pa.us >
<3399753.1710704359@sss.pgh.pa.us >
<CAEZATCULqMzbME2UEpybnBnp_U_6Yaa2Zm1BFuPFXKUq4-RXhw@mail.gmail.com >
<3691942.1710796200@sss.pgh.pa.us >
<3712528.1710803943@sss.pgh.pa.us >
<CAEZATCUzo-GnuEy8Y=5tuL=32CQy6JCDF7VxajGpm_cv6HHKjw@mail.gmail.com >
<3717916.1710806600@sss.pgh.pa.us >
<3883482.1710866540@sss.pgh.pa.us >
<CAEZATCXiwEyedNkcNOH+U7ejMn0LkUyFSHoLGGtu=bVQKDGDQA@mail.gmail.com >
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> One final case that could possibly be improved is this one from aggregates.out:
> explain (verbose, costs off)
> select array(select sum(x+y) s
> from generate_series(1,3) y group by y order by s)
> from generate_series(1,3) x;
> QUERY PLAN
> -------------------------------------------------------------------
> Function Scan on pg_catalog.generate_series x
> Output: ARRAY(SubPlan 1)
> Function Call: generate_series(1, 3)
> SubPlan 1
> -> Sort
> Output: (sum((x.x + y.y))), y.y
> Sort Key: (sum((x.x + y.y)))
> -> HashAggregate
> Output: sum((x.x + y.y)), y.y
> Group Key: y.y
> -> Function Scan on pg_catalog.generate_series y
> Output: y.y
> Function Call: generate_series(1, 3)
> ARRAY operates on a SELECT with a single targetlist item, but in this
> case it looks like the subplan output has 2 columns, which might
> confuse people.
I'm inclined to leave that alone. The actual source sub-SELECT
could only have had one column, so no real confusion is possible.
Yeah, there's a resjunk grouping column visible in the plan as well,
but those exist in many other queries, and we've not gotten questions
about them.
(Perhaps some documentation about junk columns needs to be added?
I'm not eager to write it though.)
I had actually had a similar thought about sticking ".col1" onto
EXPR_SUBLINK cases, but I concluded it was mostly pedantry.
Nobody's likely to get confused.
regards, tom lane
view thread (23+ messages) latest in thread
Message-ID: <4021298.1710884416@sss.pgh.pa.us>
Permalink: ../4021298.1710884416@sss.pgh.pa.us/
Also on: postgresql.org/message-id/4021298.1710884416@sss.pgh.pa.us
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, aleksander@timescale.com, chantal.keller@universite-paris-saclay.fr
Subject: Re: Improving EXPLAIN's display of SubPlan nodes
In-Reply-To: <4021298.1710884416@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox