Re: Reporting planning time with EXPLAIN

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reporting planning time with EXPLAIN
Date: 2017-03-07 15:53:56
Message-ID: 20170307155356.GJ9812@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ashutosh,

* Ashutosh Bapat (ashutosh(dot)bapat(at)enterprisedb(dot)com) wrote:
> Here are patches for follwing
> 1. pg_explain_plan_time_v3 adds SUMMARY option which behaves as:
> SUMMARY when ON prints planning time. With ANALYZE ON, it also prints
> execution time. When user explicitly uses SUMMARY OFF, it does not
> print planning and execution time (even when ANALYZE is ON). By
> default SUMMARY is ON when ANALYZE is ON, otherwise SUMMARY defaults
> to OFF. Attached explain_summary_examples.out.txt shows examples.
>
> 2. explain_exec_timing adds support to print planning time in EXPLAIN
> EXECUTE output with SUMMARY option. In this case, planning time
> includes time required to fetch the plan from cache and plan the query
> if necessary (i.e. after invalidation or the first time it's
> executed.) E.g.

I'm going through these with an eye towards committing them soon. I've
already adjusted some of the documentation and comments per our earlier
discussion but I'm now reviewing the changes to ExplainExecuteQuery()
and trying to understand the reasoning for not including the
EvaluateParams() call in the planning time. Not including that feels to
me like we're ending up leaving something out of the overall timing
picture, which doesn't seem right.

If we do include that, then planning time+execution time will equal the
overall query time and that feels like the right approach to use here.
Otherwise the overall query time is "planning time+execution
time+something else that we don't tell you about" which doesn't seem
good to me.

Thoughts?

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-03-07 15:59:41 Re: [BUGS] Seems bug in postgres_fdw?
Previous Message Robert Haas 2017-03-07 15:49:34 Re: WIP: Faster Expression Processing v4