On Mon, Oct 11, 2010 at 7:16 PM, Jeff Davis <pg...@j-davis.com> wrote:
> On Mon, 2010-10-11 at 16:07 -0400, Robert Haas wrote: > > >> It would be far better if we could decouple master cleanup from > > >> standby cleanup, so that only the machine that actually has the old > > >> query gets bloated. However, no one seems excited about writing that > > >> code. > > > > > > That doesn't seem just a matter of code, it seems like a major design > > > conflict. > > > > Yes. I had the idea of trying to fix this by allowing the standby to > > retain old versions of entire pages that got cleaned up on the master, > > until the transactions that might want to read the old pages were > > gone. But that may be prohibitively difficult, not sure. > > I think you'd end up having a notion of a snapshot of block information > (like a FS with snapshots) inside of postgres. > > Sounds like a lot of complexity to me, and the only benefit I see is > moving bloat from the primary to the standby. Granted, that would be > nice, but I would expect some costs aside from just the complexity. > I had this idea when HS was being initially implemented, and I saw two problems with it. .) Identifying block versions in buffers. Our XID based MVCC like scheme would work, but we already have a block header which we would want to trim. .) Effectively every block cleanup will have to create a copy of the block because more often than not there's at least one transaction in the system, and when it asks, we need to hand it the old version. Regards, -- gurjeet.singh @ EnterpriseDB - The Enterprise Postgres Company http://www.EnterpriseDB.com singh.gurj...@{ gmail | yahoo }.com Twitter/Skype: singh_gurjeet Mail sent from my BlackLaptop device