Expose explain's SUMMARY option
authorStephen Frost <sfrost@snowman.net>
Wed, 8 Mar 2017 20:14:03 +0000 (15:14 -0500)
committerStephen Frost <sfrost@snowman.net>
Wed, 8 Mar 2017 20:14:03 +0000 (15:14 -0500)
commitf9b1a0dd403ec0931213c66d5f979a3d3e8e7e30
tree714d2629895708f66b731b6ccdb0d3a2677936d0
parent15d03e597662847e13428a8b3ce9dd59c38decf3
Expose explain's SUMMARY option

This exposes the existing explain summary option to users to allow them
to choose if they wish to have the planning time and totalled run time
included in the EXPLAIN result.  The existing default behavior is
retained if SUMMARY is not specified- running explain without analyze
will not print the summary lines (just the planning time, currently)
while running explain with analyze will include the summary lines (both
the planning time and the totalled execution time).

Users who wish to see the summary information for plain explain can now
use: EXPLAIN (SUMMARY ON) query;  Users who do not want to have the
summary printed for an analyze run can use:
EXPLAIN (ANALYZE ON, SUMMARY OFF) query;

With this, we can now also have EXPLAIN ANALYZE queries included in our
regression tests by using:
EXPLAIN (ANALYZE ON, TIMING OFF, SUMMARY off) query;

I went ahead and added an example of this, which will hopefully not make
the buildfarm complain.

Author: Ashutosh Bapat
Discussion: https://postgr.es/m/CAFjFpReE5z2h98U2Vuia8hcEkpRRwrauRjHmyE44hNv8-xk+XA@mail.gmail.com
doc/src/sgml/ref/explain.sgml
src/backend/commands/explain.c
src/backend/commands/prepare.c
src/test/regress/expected/select.out
src/test/regress/sql/select.sql