Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tnyst-004P8q-3e for pgsql-general@arkaria.postgresql.org; Fri, 28 Feb 2025 11:50:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tnysu-003gTc-2Y for pgsql-general@arkaria.postgresql.org; Fri, 28 Feb 2025 11:50:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tnyst-003gTP-OR for pgsql-general@lists.postgresql.org; Fri, 28 Feb 2025 11:50:26 +0000 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tnysq-0009hx-1H for pgsql-general@postgresql.org; Fri, 28 Feb 2025 11:50:25 +0000 Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-e4419a47887so1567245276.0 for ; Fri, 28 Feb 2025 03:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740743423; x=1741348223; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=qTtfOC8z6fsgVaFL4AXbcNH+eAtRhCQr+/4SFYu19Qk=; b=GnOMZewFEq964Hb3Z6cc/5BICSnkK/HAfSvZRktMbg+8cxuUJ5WYl4i7gO8cTjsC2U 4ITZw3U7aJV00KksyIlWRH0FMldlVOJZBkjfjWCSwZxjHjF/ItK4RPkva+TJQeaoXLX7 F9KdsnB2vlvkDRWaUy09yz0L5/8TU9V9mWl0DzXSZzI6C2P3y/Wd1gOOOtRLPm9nH1Lv IXxkn9+aonalrF4OBVod+HZU34vUexufPqK7z/oofV+8NN7d1hDhdHnk8hBCLIv/S5J7 lsOhJWR320dtK0junIs98dJeGmuZhAHP+xxj9wDawGSE2a7X5HoiTfaC8SIvtXkbul82 cefw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740743423; x=1741348223; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qTtfOC8z6fsgVaFL4AXbcNH+eAtRhCQr+/4SFYu19Qk=; b=u/y+nmhacmHUT/Qe/LqNcc/kZIcn2lECXFEwDnYqaixgB2Vaecb6IGfh6B5dYgq+7a EdvsWAQZ4TEogZEPbslJRerhc0D+dnA84RzOxBNe3KuZIhFHogoBIjg9fmDGCQhcA33n ycFfSIRWpw2Vm8Bt6Rnv4S8Tdu0D9a/yVyOepa2YBStIHYp7ZIVah+JrkT/Sglj+twl6 o7FBc086Fd0u0PvAlsO3nYQO8U9tjjunaSsaM3rYNE2mg3TtB5cAvh+UkQtl/neIwkPZ Y+U2wbCT/Q5HpvJ7sXpMo81DIEisci1i7l14ldGQdjYmzc4WtmCI79zMqm2Igvol0paR OmsQ== X-Gm-Message-State: AOJu0YzP4+NluPTCMyJiSO6y4BUU6/l3S+yXpkBMpWZ6XyQYKNYzh44C lamKhr9hqwzHxppVzQG4iONA4yUC7Dhf3rKloWWu11HV63lV5HW7tu04hPZkYo1cmPTHHhQmDin 1SDayGZ5oplh1bxVwQb2OOKJkj0gE5dnm X-Gm-Gg: ASbGncv5SRiuaTa+VpfiG3RmIsal+WY66PqU3GTDxcNuWRwzn+pbR4ZZp45oJnAZ0he lD3DB5zgnFmlITqoeaYxoASzs7hjoxs7RQFfRes8v+Dii7yAFARsp1R+dnYlSl6qeny3MWhIP3C T7D/CGH58f X-Google-Smtp-Source: AGHT+IH6sE9hH/fOGTssabjAbP3xaQAb4kvFwL94gcV/FaStNy/voJG7Q2s+tAlSj8ykE8aakj2hLcPAmeKDhNoTr7k= X-Received: by 2002:a05:6902:2203:b0:e5d:dd0a:8006 with SMTP id 3f1490d57ef6-e60b2ebdaa2mr2788374276.26.1740743423461; Fri, 28 Feb 2025 03:50:23 -0800 (PST) MIME-Version: 1.0 From: KK CHN Date: Fri, 28 Feb 2025 17:21:50 +0530 X-Gm-Features: AQ5f1JptJGs9EJagvtF_6oAkgFXFfxRrGJP4JOYhG0xc36HQE4LP8GXaqgNTglQ Message-ID: Subject: Long Running query and trace potential issues To: pgsql-general Content-Type: multipart/alternative; boundary="00000000000066925a062f3269f7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000066925a062f3269f7 Content-Type: text/plain; charset="UTF-8" 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 --00000000000066925a062f3269f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
List=C2=A0

postgres=3D#= =C2=A0SELECT 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 =3D 'active';
=C2= =A0pid =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0duration =C2=A0 =C2=A0 =C2=A0 =C2= =A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0query = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | state
-= -----+-------------------------+------------------------------------------+= --------
=C2=A03957 | 17 days 12:00:30.782583 | START_REPLICATION B5/EE0= 00000 TIMELINE 1 | active
(1 row)
postgres=3D#

Postgres 16 and pgbackrest 2.52.1 on RHEL 9.4
<= br>
=C2=A0 Is this a potential issue ? It has been running for 17= days .=C2=A0 ( I have configured=C2=A0WAL replication to a standby server = and pgbackrest to a remote server )=C2=A0 is this=C2=A0 normal running 17 d= ays START_REPLICATION B5/EE000000 TIMELINE1 active ?=C2=A0 =C2=A0


Any hints=C2=A0 to further trace=C2=A0 where= the query is executing, what it's trying to perform, how to optimize i= f this is not normal=C2=A0? Any guidance is much appreciated..
Thank you,
Krishane
--00000000000066925a062f3269f7--