Re: Fractal tree indexing

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fractal tree indexing
Date: 2013-02-13 16:02:43
Message-ID: 511BB923.7040409@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.02.2013 17:49, Atri Sharma wrote:
> On 13-Feb-2013, at 20:30, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> First explain why you couldn't build it as an opclass for gist or
>> spgist ...
>
> That needs thinking about a bit.I was confused about the current indexes because they all build on BTrees.But, building an opclass with GiST should be a good solution.

That makes no sense. I don't see any way to implement this in an
opclass, and it wouldn't make sense to re-implement this for every
opclass anyway.

The basic idea of a fractal tree index is to attach a buffer to every
non-leaf page. On insertion, instead of descending all the way down to
the correct leaf page, the new tuple is put on the buffer at the root
page. When that buffer fills up, all the tuples in the buffer are
cascaded down to the buffers on the next level pages. And recursively,
whenever a buffer fills up at any level, it's flushed to the next level.
This speeds up insertions, as you don't need to fetch and update the
right leaf page on every insert; the lower-level pages are updated in
batch as a buffer fills up.

As I said earlier, this is very similar to the way the GiST buffering
build algorithm works. It could be applied to any tree-structured access
method, including b-tree, GiST and SP-GiST.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-02-13 16:08:56 Re: [COMMITTERS] pgsql: Add noreturn attributes to some error reporting functions
Previous Message Heikki Linnakangas 2013-02-13 15:53:14 Re: Setting visibility map in VACUUM's second phase