Re: Long Running query and trace potential issues

2025-02-28 Thread Ron Johnson
On Fri, Feb 28, 2025 at 6:50 AM KK CHN wrote: > List > > postgres=# SELECT PID, now() - pg_stat_activity.query_start AS duration, > query, state FROM pg_stat_activity WHERE (now() - pg > _stat_activity.query_start) > interval '5 minutes' AND state = 'active'; > pid |duration |

Re: Long Running query and trace potential issues

2025-02-28 Thread Greg Sabino Mullane
That's harmless, it is the walsender process, and it is meant to be long-running. You can modify your query and add this: AND backend_type = 'client backend' to filter out any background processes. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products

Long Running query and trace potential issues

2025-02-28 Thread KK CHN
List postgres=# SELECT PID, now() - pg_stat_activity.query_start AS duration, query, state FROM pg_stat_activity WHERE (now() - pg _stat_activity.query_start) > interval '5 minutes' AND state = 'active'; pid |duration | query | state --+--