Re: GiST insert algorithm rewrite

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: GiST insert algorithm rewrite
Date: 2010-12-13 13:20:22
Message-ID: 4D061D96.9030909@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.12.2010 15:04, Robert Haas wrote:
> On Mon, Dec 13, 2010 at 7:09 AM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-12-13 13:29:45 Increasing max # of backup blocks (was Re: GiST insert algorithm rewrite)
Previous Message Robert Haas 2010-12-13 13:04:43 Re: GiST insert algorithm rewrite