idea: reduce logical slot induced bloat when multiple databases are used

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: idea: reduce logical slot induced bloat when multiple databases are used
Date: 2020-04-04 19:58:23
Message-ID: 20200404195823.hjxc5cnnapb22hzm@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Right now we prevent dead rows in non-shared catalog tables from being
removed whenever there is a logical slot with an older catalog
xmin. Obviously that's required when the slot is in the current
database, but it's not when the slot is in a different database.

I don't think we can afford to iterate through the slots to determine
the "current database horizon" in GetSnapshotData(), but it should not
be a problem to do so in GetOldestXmin(). The latter should normally not
be called at a very high frequency.

I think in busy clusters this could help even when only one database is
in active use, because it allows relfrozenxid in template0/1 to be
advanced more aggressively.

I'm writing this down as an idea, I don't plan to work on this anytime
soon.

Greetings,

Andres Freund

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-04-04 20:37:58 Re: A problem about partitionwise join
Previous Message Tom Lane 2020-04-04 18:36:26 Re: backup manifests and contemporaneous buildfarm failures