Re: Review of: explain / allow collecting row counts without timing info

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Review of: explain / allow collecting row counts without timing info
Date: 2012-02-03 16:12:33
Message-ID: CA+TgmobAWB4D_a2_6VDMpUUurxBdea=hs7OxCgfy8smzb7sQLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 21, 2012 at 10:32 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Fri, Jan 13, 2012 at 3:07 PM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:
>>
>> Fixed. The default value of TIMING option did not work as intended, it
>> was set to true even for plain EXPLAIN (without ANALYZE). In that case
>> the EXPLAIN failed.
>>
>
> I've applied this over the "show Heap Fetches in EXPLAIN ANALYZE
> output for index-only scans" patch.  It applied and built and passes
> installcheck.
>
> I have not done a full review of this, but I want to say that I want
> this very much.  Not only can I get the row counts, but also the Heap
> Fetches and the output of BUFFERS, without the overhead of timing.  I
> haven't looked at contrib aspects of it at all.
>
> Thank you for making this.

+1.

After looking at this a bit, I think we can make the interface a bit
more convenient. I'd like to propose that we call the EXPLAIN option
"ROWS" rather than "TIMING", and that we provide the row-count
information if *either* ROWS or ANALYZE is specified.

Then, if you want rows without timing, you can say this:

EXPLAIN (ROWS) query...

Rather than, as in the approach taken by the current patch:

EXPLAIN (ANALYZE, TIMING off) query...

...which is a little more long-winded. This also has the nice
advantage of making the name of the EXPLAIN option match the name of
the INSTRUMENT flag.

Revised patch along those lines attached. Barring objections, I'll
commit this version.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
explain-rows.patch application/octet-stream 9.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2012-02-03 16:28:06 Re: Caching for stable expressions with constant arguments v6
Previous Message Tom Lane 2012-02-03 16:11:37 Re: BUG #6425: Bus error in slot_deform_tuple