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

Re: HOT patch - version 15

From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Florian Pflug" <fgp(dot)phlo(dot)org(at)gmail(dot)com>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: HOT patch - version 15
Date: 2007-09-10 19:29:21
Message-ID: 2e78013d0709101229n118ebde1ge01cfef5782df679@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-patches
On 9/11/07, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> Heikki Linnakangas wrote:
>
> >
> > Pruning does generate a WAL record at the moment. Maybe you could do
> > some kind of a quick pruning without a WAL record. Like just modify the
> > ctid of the oldest dead tuple in the chain, or the redirecting line
> > pointer if there is one, to point to the latest live tuple, without
> > removing the dead tuples or the line pointers.
>
> I am wondering what you even mean by removing the dead tuples when
> pruning.  I thought only defragmentation removed tuples.
>
>
Pruning removes intermediate dead tuples by marking their line pointers
~LP_USED and redirecting the root line pointer to the first
live/recently_dead
tuple in the chain. OTOH defragmentation moves tuples around to repair
fragmentation. IOW defragmentation is nothing but calling
PageRepairFragmentation on the page.

For example, if we have a HOT chain of 5 tuples:

1 --> 2 --> 3 --> 4 --> 5

of which, 1, 2 and 3 are DEAD, 4 is RECENTLY_DEAD and 5 is LIVE

At the end of pruning:

- line pointer of 1 is redirected to 4
- line pointers of 2 and 3 are marked ~LP_USED
- the offset of 4 and 5 is unchanged

At the end of defragmentation:

- 4 and 5 are moved to the end of the page to create a larger
contiguous free space in the page.

Thanks,
Pavan


-- 
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com

In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2007-09-10 19:41:31
Subject: Re: HOT patch - version 15
Previous:From: Bruce MomjianDate: 2007-09-10 19:23:41
Subject: Re: HOT patch - version 15

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