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

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Review of: explain / allow collecting row counts without timing info
Дата
Msg-id 3472a49cd7ede8ef615054ac08efbbb5.squirrel@sq.gransy.com
обсуждение исходный текст
Ответ на Re: Review of: explain / allow collecting row counts without timing info  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Review of: explain / allow collecting row counts without timing info  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 3 Únor 2012, 17:12, Robert Haas wrote:
> On Sat, Jan 21, 2012 at 10:32 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
>> On Fri, Jan 13, 2012 at 3:07 PM, Tomas Vondra <tv@fuzzy.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.

I don't think changing the EXPLAIN syntax this way is a good idea. I think
that one option should not silently enable/disable others, so ROWS should
not enable ANALYZE automatically. It should throw an error just like the
TIMING option does when invoked without ANALYZE (IIRC).

Which leads to syntax like this
 EXPLAIN (ANALYZE, ROWS)

and that's a bit strange because it mentions ROWS but actually manipulates
TIMING behind the curtains. You can't actually do
 EXPLAIN (ANALYZE, ROWS off)

because row counts are always collected. So I think the syntax I proposed
makes more sense.

kind regards
Tomas



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: xlog min recovery request ... is past current point ...
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Review of: explain / allow collecting row counts without timing info