idea: reduce logical slot induced bloat when multiple databases areused - Mailing list pgsql-hackers

From Andres Freund
Subject idea: reduce logical slot induced bloat when multiple databases areused
Date
Msg-id 20200404195823.hjxc5cnnapb22hzm@alap3.anarazel.de
Whole thread Raw
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: backup manifests and contemporaneous buildfarm failures
Next
From: Tom Lane
Date:
Subject: Re: A problem about partitionwise join