Re: I don't understand that EXPLAIN PLAN timings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Jan 2024 at 20:45, Jean-Christophe Boggio
<postgresql@xxxxxxxxxxxxxx> wrote:
> explain says actual time between 1.093→1.388 but final execution time says 132.880ms?!?

The 1.388 indicates the total time spent in that node starting from
just before the node was executed for the first time up until the node
returned no more tuples.

The 132.88 ms is the total time spent to start up the plan, which
includes doing things like obtaining locks (if not already obtained
during planning), opening files and allocating memory for various
things needed for the plan.  After the top-level node returns NULL it
then will print out the plan before shutting the plan down. This
shutdown time is also included in the 132.88 ms.

I don't know where exactly the extra time is spent with your query,
but it must be in one of the operations that I mentioned which takes
place either before the top node is first executed or after the top
node returns NULL.

If you're using psql, if you do \timing on, how long does EXPLAIN take
without ANALYZE? That also goes through executor startup and shutdown.
It just skips the running the executor part.

David






[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux