pgsql: Change the way parent pages are tracked during buffered GiST bui

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change the way parent pages are tracked during buffered GiST bui
Date: 2012-05-30 09:06:11
Message-ID: E1SZer5-0004IM-0S@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change the way parent pages are tracked during buffered GiST build.

We used to mimic the way a stack is constructed when descending the tree
during normal GiST inserts, but that was quite complicated during a buffered
build. It was also wrong: in GiST, the left-to-right relationships on
different levels might not match each other, so that when you know the
parent of a child page, you won't necessarily find the parent of the page to
the right of the child page by following the rightlinks at the parent level.
This sometimes led to "could not re-find parent" errors while building a
GiST index.

We now use a simple hash table to track the parent of every internal page.
Whenever a page is split, and downlinks are moved from one page to another,
we update the hash table accordingly. This is also better for performance
than the old method, as we never need to move right to re-find the parent
page, which could take a significant amount of time for buffers that were
created much earlier in the index build.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d1996ed5e8bfaf1314e7817015668029c07d3b9b

Modified Files
--------------
src/backend/access/gist/gistbuild.c | 500 +++++++++++++++++-----------
src/backend/access/gist/gistbuildbuffers.c | 69 +----
src/include/access/gist_private.h | 34 +--
3 files changed, 317 insertions(+), 286 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-05-30 14:54:54 pgsql: Fix incorrect password transformation in contrib/pgcrypto's DES
Previous Message Tom Lane 2012-05-30 03:22:29 pgsql: Rewrite --section option to decouple it from --schema-only/--dat