EXPLAIN VERBOSE vs resjunk output columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: EXPLAIN VERBOSE vs resjunk output columns
Date: 2009-08-22 00:37:31
Message-ID: 13494.1250901451@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron Mayer 2009-08-22 00:40:09 Re: revised hstore patch
Previous Message Tom Lane 2009-08-22 00:07:07 Re: Feedback about Drupal SQL debugging