Re: improve EXPLAIN for wide tables

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sami Imseih <samimseih@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2024-12-16T22:41:54Z
Lists: pgsql-hackers
I had a thought about this: I don't think EXPLAIN is ever required
to print the names of join alias variables (since the planner flattens
all join alias variables to some kind of expression over their
underlying columns).  So we could skip assigning column names to
join RTEs at all, if we know that it's EXPLAIN rather than view/rule
decompilation.  That might let us skip all the mess around
unique-ifying JOIN USING column names, too.

			regards, tom lane



Commits

  1. Skip useless calculation of join RTE column names during EXPLAIN.

  2. Use a hash table to de-duplicate column names in ruleutils.c.