Re: execution time and running time difference
От | Jeff Janes |
---|---|
Тема | Re: execution time and running time difference |
Дата | |
Msg-id | CAMkU=1yVdVYMnbGH_u24Ux+DaqiSmTAAARnUEomEVY_bvL4vow@mail.gmail.com обсуждение исходный текст |
Ответ на | execution time and running time difference (jian xu <jamesxu@outlook.com>) |
Список | pgsql-admin |
On Fri, Jul 28, 2023 at 10:58 AM jian xu <jamesxu@outlook.com> 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
В списке pgsql-admin по дате отправления: