Re: WALInsertLock tuning

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Jeff Janes <jeff.janes@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-06-07T07:27:27Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Introduce compact WAL record for the common case of commit (non-DDL).

On 07.06.2011 10:21, Simon Riggs wrote:
> On Mon, Jun 6, 2011 at 11:25 PM, Robert Haas<robertmhaas@gmail.com>  wrote:
>> It strikes me, though, that we
>> could probably get nearly all of the benefit of this patch by being
>> willing to zero the first sizeof(XLogRecord) bytes following a record,
>> but not the rest of the buffer.  That would pretty much wipe out any
>> chance of an xl_prev match, I think, and would likely still get nearly
>> all of the performance benefit.
>
> Which adds something onto the path of every XlogInsert(), rather than
> once per page, so I'm a little hesitant to agree.

You would only need to do it just before you write out the WAL. I guess 
you'd need to grab WALInsertLock in XLogWrite() to prevent more WAL 
records from being inserted on the page until you're done zeroing it, 
though.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com