Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, Jeff Janes <jeff.janes@gmail.com>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2012-03-07T07:07:37Z
Lists: pgsql-hackers
On Wed, Mar 7, 2012 at 5:32 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> What I suggest is that it should not be necessary to crawl forward one
> page at a time to figure out how many pages will be needed to store N
> bytes worth of WAL data.  You're basically implementing a division
> problem as repeated subtraction.  Getting the extra WAL-segment-start
> overhead right would be slightly tricky; but even if you didn't want to
> try to make it pure straight-line code, at the very least it seems like
> you could set it up so that the loop iterates only once per segment not
> page.

+1

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center