Re: How to debug a connection that's "active" but hanging?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to debug a connection that's "active" but hanging?
Дата
Msg-id 2985639.1626111990@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to debug a connection that's "active" but hanging?  (Jurrie Overgoor <postgresql-mailinglist@jurr.org>)
Ответы Re: How to debug a connection that's "active" but hanging?  (Vijaykumar Jain <vijaykumarjain.github@gmail.com>)
Список pgsql-general
Jurrie Overgoor <postgresql-mailinglist@jurr.org> writes:
> Hi Vijaykumar, thanks for replying. Yes, this is reproducible. About 50% 
> of the times, my connection is hanging. It's always on the same query, 
> which I shared in the previous post.

The backtraces you captured look like the query is not "hung", it's
just computing away.

A plausible interpretation of the facts you've given is that the
query's plan is unstable, and sometimes the server is choosing a plan
that takes much longer to run than other times.  Ordinarily I'd suggest
that the auto_explain extension might help you debug that, but I think
it only works on queries that do eventually complete.  You might need
to investigate by altering your application to capture "EXPLAIN ..."
output just before the troublesome query, so you can see if it gets
a different plan in the slow cases.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Use of '&' as table prefix in query
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Use of '&' as table prefix in query