From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov> |
Cc: | drkp(at)csail(dot)mit(dot)edu, heikki(dot)linnakangas(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Small SSI issues |
Date: | 2011-07-07 19:09:57 |
Message-ID: | CA+TgmobKQW+=xU5Cb3UKPCE7vheBh+EOCR4piMB2bDO+XA+CzA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Jul 5, 2011 at 12:03 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
>> Well, as long as we can verify that OLDSERXID_MAX_PAGE has the
>> same value for BLCKSZ=8K before and after this patch, I don't see
>> any real downside to applying it. If, hypothetically, it's buggy,
>> it's only going to break things for non-default block sizes which
>> are, by your description, not correct right now anyway.
>
> Outside of a code comment, the entire patch consists of replacing
> the definition of the OLDSERXID_MAX_PAGE macro. The old definition
> is:
>
> (SLRU_PAGES_PER_SEGMENT * 0x10000 - 1)
>
> SLRU_PAGES_PER_SEGMENT is define to be 32. So this is:
>
> (32 * 0x10000) - 1 = 2097151
>
> The new definition is the min of the old one and a value based on
> BLCKSZ:
>
> (MaxTransactionId + 1) / OLDSERXID_ENTRIESPERPAGE - 1)
>
> Where "entries per page" is BLCKSZ / sizeof(uint64).
>
> For an 8K BLCKSZ this is:
>
> ((0xffffffff + 1) / 1024) - 1 = 4194303
>
> So the macro is guaranteed to have the same value as it currently
> does for BLCKSZ of 16KB or lower.
I went ahead and committed this.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2011-07-07 19:21:39 | Re: Avoid index rebuilds for no-rewrite ALTER TABLE ALTER TYPE |
Previous Message | Robert Haas | 2011-07-07 19:09:31 | pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ. |