Re: GiST insert algorithm rewrite

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Bruce Momjian <bruce@momjian.us>, Teodor Sigaev <teodor@sigaev.ru>, Oleg Bartunov <oleg@sai.msu.su>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-12-13T13:20:22Z
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. New feature:

On 13.12.2010 15:04, Robert Haas wrote:
> On Mon, Dec 13, 2010 at 7:09 AM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com>  wrote:
>> Attached is an updated patch, but that issue with limited number of backup
>> blocks needs to be resolved. The straightforward way would be to change the
>> WAL format to increase the limit.
>
> Eh, is that going to bloat WAL?

Nah. The way split now works is that:

1. Split the page. Write a WAL record with the contents of the page halves.

2. Insert the downlink pointers in the parent, and set the NSN and clear 
F_FOLLOW_RIGHT flags on the child pages. A 2nd WAL record is written for 
this.

In this new patch version, at step 2, the 2nd WAL record updates the 
LSNs and takes full-page-images of the child pages if necessary. 
Previous patches overlooked that. Usually a full page image won't be 
necessary, because we just wrote the page-split WAL record at step 1 for 
those pages. It's only if a checkpoint started between in the small 
window between steps 1 and 2.

So this should have no effect on performance, but it is necessary for 
correctness.

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