Thread: pgsql: Include planning time in EXPLAIN ANALYZE output.

pgsql: Include planning time in EXPLAIN ANALYZE output.

From
Robert Haas
Date:
Include planning time in EXPLAIN ANALYZE output.

This doesn't work for prepared queries, but it's not too easy to get
the information in that case and there's some debate as to exactly
what the right thing to measure is, so just do this for now.

Andreas Karlsson, with slight doc changes by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9347baa5bbc70368f2f01438bbb8116863dac1ec

Modified Files
--------------
doc/src/sgml/perform.sgml      |   27 +++++++++++++++++++++++++++
doc/src/sgml/ref/explain.sgml  |   17 ++++++++++++-----
src/backend/commands/explain.c |   24 +++++++++++++++++++++---
src/backend/commands/prepare.c |    2 +-
src/include/commands/explain.h |    4 ++--
5 files changed, 63 insertions(+), 11 deletions(-)


Re: pgsql: Include planning time in EXPLAIN ANALYZE output.

From
Peter Geoghegan
Date:
On Wed, Jan 29, 2014 at 1:10 PM, Robert Haas <rhaas@postgresql.org> wrote:
> Include planning time in EXPLAIN ANALYZE output.

Isn't it perhaps a little confusing that "Planning time" may well
exceed "Total runtime"? I'm aware that we aren't super clear on the
accounting here generally, as with pg_stat_statements, which doesn't
include planning time in total_time, while we aren't even explicit
about that in the documentation. But even still, seeing the two
side-by-side, with planning time > total runtime did give me pause.


--
Peter Geoghegan


Re: pgsql: Include planning time in EXPLAIN ANALYZE output.

From
Tom Lane
Date:
Peter Geoghegan <pg@heroku.com> writes:
> On Wed, Jan 29, 2014 at 1:10 PM, Robert Haas <rhaas@postgresql.org> wrote:
>> Include planning time in EXPLAIN ANALYZE output.

> Isn't it perhaps a little confusing that "Planning time" may well
> exceed "Total runtime"?

Perhaps s/Total runtime/Execution time/ ?

            regards, tom lane


Re: pgsql: Include planning time in EXPLAIN ANALYZE output.

From
Peter Geoghegan
Date:
On Sun, Feb 2, 2014 at 8:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Perhaps s/Total runtime/Execution time/ ?

+1


--
Peter Geoghegan


Re: [HACKERS] pgsql: Include planning time in EXPLAIN ANALYZE output.

From
Gavin Flower
Date:
On 03/02/14 09:44, Peter Geoghegan wrote:
> On Sun, Feb 2, 2014 at 8:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Perhaps s/Total runtime/Execution time/ ?
> +1
>
>
If the planning was ever made into a parallel process, then 'elapsed
time' would be less than the 'processor time'.  So what does 'Execution
time' mean?

Can I assume:
'Total runtime' is 'elapsed time'
and
'Execution time' is 'processor time'.

In a parallel implementation, one would likely want both.

Possible this is not an issue now, and I'm thinking to far ahead!


Cheers,
Gavin


Re: [HACKERS] pgsql: Include planning time in EXPLAIN ANALYZE output.

From
Tom Lane
Date:
Gavin Flower <GavinFlower@archidevsys.co.nz> writes:
> Can I assume:
> 'Total runtime' is 'elapsed time'
> and
> 'Execution time' is 'processor time'.

No.  It's going to be elapsed time, either way.

> In a parallel implementation, one would likely want both.

When and if we have that, we can argue about what to measure.

            regards, tom lane