Re: [HACKERS] Reporting planning time with EXPLAIN

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [HACKERS] Reporting planning time with EXPLAIN
Дата
Msg-id CAA4eK1JO9btPoGkC5P1wp1LWRJS7nL07E0--gsEG67Bb2MKXcw@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Reporting planning time with EXPLAIN  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Список pgsql-hackers
On Wed, Dec 28, 2016 at 8:41 PM, Stephen Frost <sfrost@snowman.net> wrote:
> * Ashutosh Bapat (ashutosh.bapat@enterprisedb.com) wrote:
>> >> One can use this option as
>> >> postgres=# explain (summary on) select * from pg_class c, pg_type t
>> >> where c.reltype = t.oid;
>> >>                                 QUERY PLAN
>> >> --------------------------------------------------------------------------
>> >>  Hash Join  (cost=17.12..35.70 rows=319 width=511)
>> >>    Hash Cond: (c.reltype = t.oid)
>> >>    ->  Seq Scan on pg_class c  (cost=0.00..14.19 rows=319 width=259)
>> >>    ->  Hash  (cost=12.61..12.61 rows=361 width=256)
>> >>          ->  Seq Scan on pg_type t  (cost=0.00..12.61 rows=361 width=256)
>> >>  Planning time: 48.823 ms
>> >> (6 rows)
>> >>
>> >> When analyze is specified, summary is also set to ON. By default this
>> >> flag is OFF.
>> >>
>> >
>> > I am not sure whether using *summary* to print just planning time is a
>> > good idea.  Another option could be SUMMARY_PLAN_TIME.
>>
>> I have just used the same name as the boolean which controls the
>> printing of planning time. Suggestions are welcome though. We haven't
>> used words with "_" for EXPLAIN options, so I am not sure about
>> SUMMARY_PLAN_TIME.
>
> Using 'summary' seems entirely reasonable to me, I don't think we need
> to complicate it by saying 'summary_plan_time'- I know that I'd had to
> have to write that out.
>
>> > + /* Execution time matters only when analyze is requested */
>> > + if (es->summary && es->analyze)
>> >
>> > Do you really need es->summary in above check?
>
> I'm pretty sure we do.
>
> EXPLAIN (ANALYZE, SUMMARY OFF)
>
> Should not print the summary (which means it shouldn't print either the
> planning or execution time).
>

Hmm, have you checked what output patch gives for above command, in
above usage, it will print both planning and execution time.  IIUC,
then patch doesn't do what you have in mind.   As far as I understand
the proposed usage for the summary parameter was only for planning
time.  Now if you want to mean that it should be used to print the
last two lines of Explain output (planning or execution time), then I
think patch requires some change.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] Duplicate node tag assignments
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] pg_stat_activity.waiting_start