pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Skip useless calculation of join RTE column names during EXPLAIN
Date: Tue, 17 Dec 2024 20:52:25 +0000
Message-ID: <E1tNeYK-0005Ps-Nb@gemulon.postgresql.org> (raw)

Skip useless calculation of join RTE column names during EXPLAIN.

There's no need for set_simple_column_names() to compute unique
column names for join RTEs, because a finished plan tree will
not contain any join alias Vars that we could need names for.
Its other, internal callers will not pass it any join RTEs
anyway, so the upshot is we can just skip join RTEs here.

Aside from getting rid of a klugy against-its-documentation use of
set_relation_column_names, this can speed up EXPLAIN substantially
when considering many-join queries, because the upper join RTEs
tend to have a lot of columns.

Sami Imseih, with cosmetic changes by me

Discussion: https://postgr.es/m/CAA5RZ0th3q-0p1pri58z9grG8r8azmEBa8o1rtkwhLmJg_cH+g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7a80e381d16c642d00ec6146ccdf1262a159c69e

Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)



Message-ID: <E1tNeYK-0005Ps-Nb@gemulon.postgresql.org>
Permalink:  ../E1tNeYK-0005Ps-Nb@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tNeYK-0005Ps-Nb@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Skip useless calculation of join RTE column names during EXPLAIN
  In-Reply-To: <E1tNeYK-0005Ps-Nb@gemulon.postgresql.org>

* 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