pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Teodor Sigaev <teodor@sigaev.ru>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API
Date: Tue, 17 May 2016 11:35:46 -0400
Message-ID: <1146.1463499346@sss.pgh.pa.us> (raw)
In-Reply-To: <573A450D.6090607@sigaev.ru>
References: <E1b2PeD-00021o-NR@gemulon.postgresql.org>
	<CAB7nPqShY5XdW5CrDxsN5OUag+zb+TM-J4nYpMjisa+hQbLaCw@mail.gmail.com>
	<573A450D.6090607@sigaev.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Teodor Sigaev <teodor@sigaev.ru> writes:
>> Instead of allocating this memory unconditionally for each buffer,
>> wouldn't it be better to set all the page pointers to NULL in
>> GenericXLogStart and allocate memory only once a buffer is registered
>> in GenericXLogRegisterBuffer when finding a free slot? This patch is
>> wasting many cycles.

> GenericXLogRegisterBuffer() could be called in another MemoryContext what
> can be a reason for strange bugs. Right now only a few pages could be
> involved in one round of GenericWal. I don't believe that such allocation
> could be a reason of noticable performance degradation. Although I didn't
> check that.

You could allocate all the pages in one palloc, though, and then just
set the pointers via address arithmetic.

			regards, tom lane


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



view thread (4+ messages)

Message-ID: <1146.1463499346@sss.pgh.pa.us>
Permalink:  ../1146.1463499346@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1146.1463499346@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, teodor@sigaev.ru, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API
  In-Reply-To: <1146.1463499346@sss.pgh.pa.us>
  References: <E1b2PeD-00021o-NR@gemulon.postgresql.org> <CAB7nPqShY5XdW5CrDxsN5OUag+zb+TM-J4nYpMjisa+hQbLaCw@mail.gmail.com> <573A450D.6090607@sigaev.ru> <1146.1463499346@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox