Re: CLUSTER FREEZE - Mailing list pgsql-hackers

From David Rowley
Subject Re: CLUSTER FREEZE
Date
Msg-id CAApHDvrNLbm3PVqqj6tG73h1WxR_41C3ZNQCPACJxOemDEe=Hg@mail.gmail.com
Whole thread Raw
In response to Re: CLUSTER FREEZE  (Thomas Munro <munro@ip9.org>)
Responses Re: CLUSTER FREEZE  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On Sat, Oct 26, 2013 at 11:19 AM, Thomas Munro <munro@ip9.org> wrote:
On 25 October 2013 01:17, Josh Berkus <josh@agliodbs.com> wrote:
On 10/24/2013 04:55 PM, Robert Haas wrote:
> I wonder if we should go so far as to make this the default behavior,
> instead of just making it an option.

+1 from me.  Can you think of a reason you *wouldn't* want to freeze?

Ok, I attach an alternative patch that makes CLUSTER *always* freeze, without any option (but doesn't affect VACUUM FULL in the same way). I will post both alternatives to the commitfest app since there seems to be some disagreement about whether tuple freezing should be an optional.


It seems that most people to voice their opinion are leaning towards this being the more desired behaviour rather than adding the FREEZE as an option, so I reviewed this patch tonight.

I followed the code around and checked that we do still need the freeze age parameters in cluster_rel and we do because vacuum full uses the cluster_rel code and it will only perform a freeze if a user does VACUUM FULL FREEZE. 

I have mixed feelings about updating the comment before the call to vacuum_set_xid_limits. It looks like the previous comment probably had not been looked at since vacuum full started using cluster_rel, so perhaps removing that was good, but on the other hand maybe it should be mentioning vacuum full and vacuum full freeze? Though I'm probably leaning more towards what you've changed it to as previously the comment was being a bit too clever and assuming things about the calling code which turned out bad as it seemed out of date and lacked knowledge of vacuum full using it.

I think that the patch should include some sort of notes in the documents to say that cluster performs freezing of tuples. I've attached a patch which adds something there, but I'm not 100% sure it is the right thing. Perhaps it should just read:

Cluster also performs aggressive "freezing" of tuples similar to VACUUM FULL FREEZE.

Although it's not exactly the same as you can perform a vacuum full freeze on a relation which does not have the clustered index set.

I'll delay a bit to see if anyone else has any comments about what the docs should read, but I think it is pretty much ready for a commiter's eyes.

Regards

David Rowley


 
Thanks
Thomas Munro


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Attachment

pgsql-hackers by date:

Previous
From: Rohit Goyal
Date:
Subject: Re: Call flow of btinsert(PG_FUNCTION_ARGS)
Next
From: Amit Langote
Date:
Subject: Re: Call flow of btinsert(PG_FUNCTION_ARGS)