Requesting clarification on Vacuuming/Freezing behaviour

Started by Gokulakannan Somasundaramabout 18 years ago3 messages
#1Gokulakannan Somasundaram
gokul007@gmail.com

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)

#2Heikki Linnakangas
heikki@enterprisedb.com
In reply to: Gokulakannan Somasundaram (#1)
Re: Requesting clarification on Vacuuming/Freezing behaviour

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

#3Gokulakannan Somasundaram
gokul007@gmail.com
In reply to: Heikki Linnakangas (#2)
Re: Requesting clarification on Vacuuming/Freezing behaviour

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

On Dec 17, 2007 1:39 PM, Heikki Linnakangas <heikki@enterprisedb.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)