Requesting clarification on Vacuuming/Freezing behaviour

Lists: pgsql-hackers
From: "Gokulakannan Somasundaram" <gokul007(at)gmail(dot)com>
To: "pgsql-hackers list" <pgsql-hackers(at)postgresql(dot)org>
Subject: Requesting clarification on Vacuuming/Freezing behaviour
Date: 2007-12-17 07:47:21
Message-ID: 9362e74e0712162347g65ef8165wbe5dc6fd514539ff@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,
I got some time to relook at the index with the snapshot patch. Still i
need to complete the freezing of index tuples with the snapshot.
a) When i was looking at the code for freezing heap tuples, i found out the
following. While freezing we log the complete block(not just the tuples we
froze).
b) Again after removing the dead tuples and fragmentation, we log the
complete block.

As i understand, Vacuum is one atomic operation. Why do we need to make this
extra protection for Freezing?
I think the fix should be very simple. Before logging the Frozen block, we
need to check whether there are any dead tuples removed from it..

Please clarify on whether i am missing something important..

--
Thanks,
Gokul.
CertoSQL Project,
Allied Solution Group.
(www.alliedgroups.com)


From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
Cc: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Requesting clarification on Vacuuming/Freezing behaviour
Date: 2007-12-17 08:09:17
Message-ID: 47662EAD.4080405@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Gokulakannan Somasundaram wrote:
> a) When i was looking at the code for freezing heap tuples, i found out the
> following. While freezing we log the complete block(not just the tuples we
> froze).
> b) Again after removing the dead tuples and fragmentation, we log the
> complete block.

Umm, no we don't. In log_heap_freeze, we log an array of offsets, of
those tuples that were frozen.

Perhaps you're been confused by full page writes? If a block hasn't been
modified by last checkpoint, then we do log the whole page for any
operation, including vacuuming and freezing. (except setting hint bits).

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


From: "Gokulakannan Somasundaram" <gokul007(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "pgsql-hackers list" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Requesting clarification on Vacuuming/Freezing behaviour
Date: 2007-12-17 13:26:04
Message-ID: 9362e74e0712170526h64f8e9eka2779ab57ff22b74@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks Heikki. I misunderstood things. Especially the comment in
log_heap_freeze misled me.

On Dec 17, 2007 1:39 PM, Heikki Linnakangas <heikki(at)enterprisedb(dot)com> wrote:

> Gokulakannan Somasundaram wrote:
> > a) When i was looking at the code for freezing heap tuples, i found out
> the
> > following. While freezing we log the complete block(not just the tuples
> we
> > froze).
> > b) Again after removing the dead tuples and fragmentation, we log the
> > complete block.
>
> Umm, no we don't. In log_heap_freeze, we log an array of offsets, of
> those tuples that were frozen.
>
> Perhaps you're been confused by full page writes? If a block hasn't been
> modified by last checkpoint, then we do log the whole page for any
> operation, including vacuuming and freezing. (except setting hint bits).
>
> --
> Heikki Linnakangas
> EnterpriseDB http://www.enterprisedb.com
>

--
Thanks,
Gokul.
CertoSQL Project,
Allied Solution Group.
(www.alliedgroups.com)