Re: GiST insert algorithm rewrite - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: GiST insert algorithm rewrite
Date
Msg-id 4D0A19A1.2040700@enterprisedb.com
Whole thread Raw
In response to Re: GiST insert algorithm rewrite  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: GiST insert algorithm rewrite  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On 13.12.2010 20:30, Tom Lane wrote:
> Can we fix it so that each child page is updated, and its downlink
> inserted, as a separate atomic action?  That'd require each intermediate
> state to be consistent and crash-safe, but I think you really need the
> intermediate states to be consistent anyway because of concurrent scans.

Here's an updated patch, using that idea.If a page split into more than
two pages, the downlinks for the pages are inserted to the parent
one-by-one, right-to-left, until there's only two remaining. Finally the
downlink for the last remaining right page is inserted and the downlink
for the original page is updated as one atomic operation.

It was a pretty big rewrite again, but seems to work now. I tested
splits that span more than two pages by rigging the btree_gist picksplit
function to choose very bad split points, and the fix-split logic by
adding elog(ERROR) in strategic places to sometimes leave splits incomplete.

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

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] V3: Idle in transaction cancellation
Next
From: Robert Haas
Date:
Subject: Re: Instrument checkpoint sync calls