Обсуждение: Requesting clarification on Vacuuming/Freezing behaviour

Поиск
Список
Период
Сортировка

Requesting clarification on Vacuuming/Freezing behaviour

От
"Gokulakannan Somasundaram"
Дата:
Hi,<br />    I got some time to relook at the index with the snapshot patch. Still i need to complete the freezing of
indextuples with the snapshot.<br />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). <br />b) Again after removing the
deadtuples and fragmentation, we log the complete block.<br /><br />As i understand, Vacuum is one atomic operation.
Whydo we need to make this extra protection for Freezing?<br />I think the fix should be very simple. Before logging
theFrozen block, we need to check whether there are any dead tuples removed from it.. <br /><br />Please clarify on
whetheri am missing something important..<br clear="all" /><br />-- <br />Thanks,<br />Gokul.<br />CertoSQL Project,<br
/>AlliedSolution Group.<br />(<a href="http://www.alliedgroups.com">www.alliedgroups.com </a>)  

Re: Requesting clarification on Vacuuming/Freezing behaviour

От
Heikki Linnakangas
Дата:
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


Re: Requesting clarification on Vacuuming/Freezing behaviour

От
"Gokulakannan Somasundaram"
Дата:
Thanks Heikki. I misunderstood things. Especially the comment in log_heap_freeze misled me.<br /><br /><div
class="gmail_quote">OnDec 17, 2007 1:39 PM, Heikki Linnakangas <<a
href="mailto:heikki@enterprisedb.com">heikki@enterprisedb.com</a>> wrote:<br /><blockquote class="gmail_quote"
style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div
class="Ih2E3d">GokulakannanSomasundaram wrote:<br />> a) When i was looking at the code for freezing heap tuples, i
foundout the <br />> following. While freezing we log the complete block(not just the tuples we<br />> froze).<br
/>>b) Again after removing the dead tuples and fragmentation, we log the<br />> complete block.<br /><br
/></div>Umm,no we don't. In log_heap_freeze, we log an array of offsets, of <br />those tuples that were frozen.<br
/><br/>Perhaps you're been confused by full page writes? If a block hasn't been<br />modified by last checkpoint, then
wedo log the whole page for any<br />operation, including vacuuming and freezing. (except setting hint bits). <br
/><fontcolor="#888888"><br />--<br />   Heikki Linnakangas<br />   EnterpriseDB   <a href="http://www.enterprisedb.com"
target="_blank">http://www.enterprisedb.com</a><br/></font></blockquote></div><br /><br clear="all" /><br />-- <br
/>Thanks,<br/>Gokul.<br />CertoSQL Project,<br />Allied Solution Group.<br />(<a
href="http://www.alliedgroups.com">www.alliedgroups.com</a>)