Re: use less space in xl_xact_commit patch

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Leonardo Francalanci <m_lists(at)yahoo(dot)it>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: use less space in xl_xact_commit patch
Date: 2011-05-25 14:41:26
Message-ID: BANLkTin16o=e4zxjN+s=WPCRAu_uq4JJOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 25, 2011 at 2:43 PM, Leonardo Francalanci <m_lists(at)yahoo(dot)it> wrote:
>> Da: Simon Riggs <simon(at)2ndQuadrant(dot)com>
>> I can't find a clear  discussion of what you are trying to do, and how,
>> just a URL back to a  complex discussion on another topic.
>
>
> While trying to write a patch to allow changing an unlogged table into
> a logged one, I had to add another int field to xl_xact_commit.
> Robert Haas said:
>
>  "I have to admit I don't like this approach very much.  I can't see
> adding 4 bytes to every commit record for this feature."
>
>
> which is a correct remark.
>
> xl_xact_commit can contain some arrays (relation to drops,
> committed sub-trans, shared invalidation msgs). The length of
> these arrays is specified using 3 ints in the struct.
>
> So, to avoid adding more ints to the struct, I've been suggested to
> remove all the ints, and use   xl_xact_commit.xinfo to flag which
> arrays are, in fact, present.
>
> So the whole idea is:
>
> - remove nrels, nsubxacts and nmsgs from xl_xact_commit
> - use bits in xinfo to signal which arrays are present at the end
> of   xl_xact_commit
> - for each present array, add the length of the array (as int) at
> the end of    xl_xact_commit
> - add each present array after all the lengths

OK, thats clear. Thanks.

That formatting sounds quite complex.

I would propose we split this into 2 WAL records: xl_xact_commit and
xl_xact_commit_with_info

xl_xact_commit doesn't have any flags, counts or arrays.

xl_xact_commit_with_info always has all 3 counts, even if zero.
Arrays follow the main record

I think it might also be possible to removed dbId and tsId from
xl_act_commit if we use that definition.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-25 14:47:56 Re: Nested CASE-WHEN scoping
Previous Message Hitoshi Harada 2011-05-25 14:35:53 Re: Pull up aggregate subquery