Skip site navigation (1) Skip section navigation (2)

BTree vacuum before page splitting

From: Junji TERAMOTO <teramoto(dot)junji(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Subject: BTree vacuum before page splitting
Date: 2006-01-27 10:38:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Hi all,

This patch adds a function to remove unnecessary items before split
page of BTree.

When a new item is put in the page, it looks for the "LP_DELETE" item,
and removes that item. No heap access is required. Moreover, the penalty
is also few because it operates instead of page split.

Only when the super-exclusive lock was able to obtain, it removes
items because the deletion of the item might disturb the simultaneous
execution of the index scanning.
It is an optimistic control.

Because own scan might be lost even if the super-exclusive lock can
obtain, we also modify _bt_restscan().

The growth of the index frequently updated by using this patch can be

Your comments are welcome. Thanks.

For example(pgbench):
transaction type: TPC-B (sort of)
scaling factor: 100
number of clients: 50
number of transactions per client: 5000
number of transactions actually processed: 250000/250000

Relation Name         File Name Tuples   Pages File Size
public.accounts_pkey  16568     10001200 21899 175192
public.branches_pkey  16564          100   410   3280
public.tellers_pkey   16566         1000   374   2992

Relation Name         File Name Tuples   Pages File Size
public.accounts_pkey  16688     10004100 21899 175192
public.branches_pkey  16684          100    44    352 <==
public.tellers_pkey   16686         1000    26    208 <==

We also test this patch on DBT-2.

Junji Teramoto / teramoto.junji (a)
NTT Cyber Space Lab.

Attachment: btsplitvacuum-0124a.patch
Description: text/plain (7.2 KB)


pgsql-patches by date

Next:From: NAKANO YoshihisaDate: 2006-01-27 13:49:12
Subject: Patch for ALTER TABLE / TYPE
Previous:From: Thomas HallgrenDate: 2006-01-27 09:56:25
Subject: Re: Adding a --quiet option to initdb

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group