Re: [PATCH] XLogReadRecord returns pointer to currently read page

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: a(dot)lepikhov(at)postgrespro(dot)ru, hlinnaka(at)iki(dot)fi, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] XLogReadRecord returns pointer to currently read page
Date: 2018-11-16 06:23:55
Message-ID: 20181116062355.GE6613@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 15, 2018 at 06:12:38PM +0900, Kyotaro HORIGUCHI wrote:
> This patch eliminates unnecessary copying that was done for
> non-continued records. Now the return value of XLogReadRecord
> directly points into page buffer holded in XLogReaderStats. It is
> safe because no caller site uses the returned pointer beyond the
> replacement of buffer content at the next call to the same
> function.

I was looking at this patch, and shouldn't we worry about compatibility
with plugins or utilities which look directly at what's in readRecordBuf
for the record contents? Let's not forget that the contents of
XLogReaderState are public.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-11-16 06:47:52 Re: Speeding up INSERTs and UPDATEs to partitioned tables
Previous Message John Naylor 2018-11-16 05:01:36 Re: [RFC] Removing "magic" oids