Re: getting rid of freezing - Mailing list pgsql-hackers

From Andres Freund
Subject Re: getting rid of freezing
Date
Msg-id 20130528232242.GA818@awork2.anarazel.de
Whole thread Raw
In response to Re: getting rid of freezing  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On 2013-05-28 09:29:26 -0700, Josh Berkus wrote:
> On 05/28/2013 07:17 AM, Andres Freund wrote:
> > On 2013-05-26 16:58:58 -0700, Josh Berkus wrote:
> >> I was talking this over with Jeff on the plane, and we wanted to be
> >> clear on your goals here:  are you looking to eliminate the *write* cost
> >> of freezing, or just the *read* cost of re-reading already frozen pages?
> > 
> > Both. The latter is what I have seen causing more hurt, but the former
> > alone is painful enough.
> 
> I guess I don't see how your proposal is reducing the write cost for
> most users then?
> 
> - for users with frequently, randomly updated data, pdallvisible would
> not be ever set, so they still need to be rewritten to freeze

If they update all data they simply never need to get frozen since they
are not old enough.

> - for users with append-only tables, allvisible would never be set since
> those pages don't get vacuumed

They do get vacuumed at least every autovacuum_freeze_max_age even
now. And we should vacuum them more often to make index only scan work
without manual intervention.

> - it would prevent us from getting rid of allvisible, which has a
> documented and known write overhead

Aha.

> This means that your optimization would benefit only users whose pages
> get updated occasionally (enough to trigger vaccuum) but not too
> frequently (which would unset allvisible).  While we lack statistics,
> intuition suggests that this is a minority of databases.

I don't think that follows.

> If we just wanted to reduce read cost, why not just take a simpler
> approach and give the visibility map a "isfrozen" bit?  Then we'd know
> which pages didn't need rescanning without nearly as much complexity.
> That would also make it more effective to do precautionary vacuum freezing.

Because we would still write/dirty/xlog the changes three times?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Unsigned integer types
Next
From: Andres Freund
Date:
Subject: Re: preserving forensic information when we freeze