Hello, after exhanging with Dmitry, I see I'm not the only one with doubts
about this code in idx.cpp at approx line 340:

Record* gc_record = VIO_gc_record(tdbb, relation);

// Unless this is the only attachment or a database restore, worry about
// preserving the page working sets of other attachments.
if (attachment && 
        (attachment != dbb->dbb_attachments || attachment->att_next))
{
        if ((attachment->att_flags & ATT_gbak_attachment) ||
                DPM_data_pages(tdbb, relation) > dbb->dbb_bcb->bcb_count)
        {
                primary.getWindow(tdbb).win_flags = 
                        secondary.getWindow(tdbb).win_flags =
WIN_large_scan;
                primary.rpb_org_scans = 
                        secondary.rpb_org_scans =
relation->rel_scan_count++;
        }
}

If this is restore, only gbak is connected (single attachment). The outer
"if" says that there are many attachments. I thought the comment was
misplaced and it referred to backup, but Dmitry pointed out the obvious: the
code is inside IDX_create_index, so if it's gbak, it should be restore (not
backup), then single attachment. Hence, the condition
(attachment->att_flags & ATT_gbak_attachment)
seems impossible. I could delete that part of the condition or someone
please suggest another interpretation. Maybe the code was intended to run
when someone is running a script with objects creation in an actively used
DB?

C.
---
Claudio Valderrama C.
Consultant, SW developer.


------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to