Re: execution time and running time difference

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

 



On Fri, Jul 28, 2023 at 10:58 AM jian xu <jamesxu@xxxxxxxxxxx> wrote:

Hello,

          I enabled the \timing in psql, and run a query with explain analyze,

In the output, the execution time(from analyze) is 28 seconds, the query only returns  14 rows, however the Time(from timing) is more than a minute. Could someone help me explain the difference between execution time and running time? And how did it happen, any possible cause? Thanks

James

 


Time needed to acquire a table lock will be included in \timing, but (generally) not in explain analyze, so that is a very plausible explanation.  If you turned on log_lock_waits, you could look in the log file to see if there were any long blockings at this time. 

Or if you are connecting through pgbouncer with statement or transaction pooling, maybe it just took a while for a real connection to become available.

Cheers,

Jeff

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux