EXPLAIN VERBOSE vs resjunk output columns - Mailing list pgsql-hackers

From Tom Lane
Subject EXPLAIN VERBOSE vs resjunk output columns
Date
Msg-id 13494.1250901451@sss.pgh.pa.us
Whole thread Raw
Responses Re: EXPLAIN VERBOSE vs resjunk output columns  (Stephen Frost <sfrost@snowman.net>)
Re: EXPLAIN VERBOSE vs resjunk output columns  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Currently, explain.c goes out of its way to not print "resjunk" output
columns (those not meant to be seen by the user, such as hidden sort key
columns) in EXPLAIN VERBOSE targetlists.  I made 8.4 act that way for
reasons I don't recall at the moment, but I've found several times now
that it's misleading.  Would anybody complain about including those
columns?

An example of what I'm talking about:

regression=# explain verbose select unique1 from tenk1 order by tenthous;                              QUERY PLAN
                       
 
------------------------------------------------------------------------Sort  (cost=1122.39..1147.39 rows=10000
width=8) Output: unique1  Sort Key: tenk1.tenthous  ->  Seq Scan on public.tenk1  (cost=0.00..458.00 rows=10000
width=8)       Output: unique1
 
(5 rows)

The seqscan is actually emitting both unique1 and tenthous, as it
obviously must or the sort node would have nothing to work with.
You can see that from the fact that the estimated row width is
8 bytes (two integers) ... but tenthous is nowhere to be seen in the
Output: line.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Feedback about Drupal SQL debugging
Next
From: Ron Mayer
Date:
Subject: Re: revised hstore patch