public inbox for [email protected]  
help / color / mirror / Atom feed
Long Running query and trace potential issues
2+ messages / 2 participants
[nested] [flat]

* Long Running query and trace potential issues
@ 2025-02-28 11:51 KK CHN <[email protected]>
  2025-02-28 12:38 ` Re: Long Running query and trace potential issues Greg Sabino Mullane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: KK CHN @ 2025-02-28 11:51 UTC (permalink / raw)
  To: pgsql-general

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
------+-------------------------+------------------------------------------+--------
 3957 | 17 days 12:00:30.782583 | START_REPLICATION B5/EE000000 TIMELINE 1
| active
(1 row)
postgres=#

Postgres 16 and pgbackrest 2.52.1 on RHEL 9.4

  Is this a potential issue ? It has been running for 17 days .  ( I have
configured WAL replication to a standby server and pgbackrest to a remote
server )  is this  normal running 17 days START_REPLICATION B5/EE000000
TIMELINE1 active ?


Any hints  to further trace  where the query is executing, what it's trying
to perform, how to optimize if this is not normal ? Any guidance is much
appreciated..

Thank you,
Krishane


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Long Running query and trace potential issues
  2025-02-28 11:51 Long Running query and trace potential issues KK CHN <[email protected]>
@ 2025-02-28 12:38 ` Greg Sabino Mullane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Greg Sabino Mullane @ 2025-02-28 12:38 UTC (permalink / raw)
  To: KK CHN <[email protected]>; +Cc: pgsql-general

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 & Tech Support


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-02-28 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-28 11:51 Long Running query and trace potential issues KK CHN <[email protected]>
2025-02-28 12:38 ` Greg Sabino Mullane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox