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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to