Re: [EXT] DBeaver session populating pg_stat_activity.backend_xmin

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: "Dirschel, Steve" <steve(dot)dirschel(at)thomsonreuters(dot)com>
Cc: Thomas Kellerer <shammat(at)gmx(dot)net>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: [EXT] DBeaver session populating pg_stat_activity.backend_xmin
Date: 2023-01-25 22:49:17
Message-ID: E11FB0E3-54F5-45A2-9C5C-1AEAAFADB62F@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jan 25, 2023, at 14:21, Dirschel, Steve <steve(dot)dirschel(at)thomsonreuters(dot)com> wrote:
> From my perspective "idle in transaction" isn't necessarily a problem (although I don't like seeing sessions sitting like that for a long time). The problem is when pg_stat_activity.backend_xmin is populated- that can prevent autovacuum from cleaning up old records.

I don't think that analysis is quite correct. There's nothing about backend_xmin that blocks tuple cleanup *if the transaction has been committed*. The problem is that the session is sitting in idle in transaction state, and *that* blocks tuple cleanup. The fix is to not leave sessions open in idle in transaction state.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message veem v 2023-01-26 19:17:36 Sequence vs UUID
Previous Message Ron 2023-01-25 22:34:08 Re: [EXT] Re: DBeaver session populating pg_stat_activity.backend_xmin