About index_build

Started by Alexey Slynkoalmost 21 years ago2 messages
#1Alexey Slynko
slynko@tronet.ru

Hi,

I have found comments in backend/catalog/index.c, that
index_build closes the passed rels ( heapRelation and indexRelation ).
But in backend/access/nbtree/nbtree.c I see something like this:

if (IsNormalProcessingMode())
{
....
heap_close(heap, NoLock);
index_close(index);
....
}

Why it is not like

if (IsNormalProcessingMode())
{
....
heap_close(heap, NoLock);
index_close(index);
....
}
else {
heap_close(heap, NoLock);
index_close(index);
}

Is it a bug or feature ?

Alexey Slynko
E-mail: slynko@tronet.ru

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexey Slynko (#1)
Re: About index_build

Alexey Slynko <slynko@tronet.ru> writes:

I have found comments in backend/catalog/index.c, that
index_build closes the passed rels ( heapRelation and indexRelation ).

Bootstrap mode does it differently. I've never really felt motivated to
understand why in any detail. Presumably it was once *necessary* for
bootstrap to behave like that, and maybe it still is or maybe not.
It ain't broke so why fix it ...

regards, tom lane