Message 52

Re: a few more questions...

X-Added: With Flames (bblib $Revision: 1.4 $)
Return-path: <spapadim+@cs.cmu.edu>
X-Andrew-Authenticated-as: 0;andrew.cmu.edu;Network-Mail
Received: from po0.andrew.cmu.edu via trymail for bb+academic.cs.15-721@andrew.cmu.edu
          ID </afs/andrew.cmu.edu/usr0/bb/Mailbox/ovjXj8S00UdYBNOE4b>;
          Fri,  5 Oct 2001 19:01:28 -0400 (EDT)
Received: from mx2.andrew.cmu.edu (MX2.ANDREW.CMU.EDU [128.2.10.112])
        by po0.andrew.cmu.edu (8.9.3/8.9.3) with ESMTP id TAA22885
        for <bb+academic.cs.15-721@ams.andrew.cmu.edu>; Fri, 5 Oct 2001 19:01:28 -0400 (EDT)
Received: from iluvatar.dhs.org (pool-151-201-19-40.pitt.east.verizon.net [151.201.19.40])
        by mx2.andrew.cmu.edu (8.12.0.Beta16/8.12.0.Beta16) with ESMTP id f95N1Rtx030931
        for <bb+academic.cs.15-721@andrew.cmu.edu>; Fri, 5 Oct 2001 19:01:27 -0400
Received: from cs.cmu.edu (iluvatar.hobbiton.cmu.edu [192.168.0.2])
        by iluvatar.dhs.org (Postfix) with ESMTP
        id A9B4020503; Fri,  5 Oct 2001 19:01:23 -0400 (EDT)
Message-ID: <3BBE3BC2.3090108@cs.cmu.edu>
Date: Fri, 05 Oct 2001 19:01:22 -0400
From: Spiros Papadimitriou <spapadim+@cs.cmu.edu>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010808
X-Accept-Language: en-us
MIME-Version: 1.0
To: Francisco Pereira <fpereira+@cs.cmu.edu>
Cc: bb+academic.cs.15-721@andrew.cmu.edu
Subject: Re: a few more questions...
References: <3BBE2AA2.AC071A60@cs.cmu.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

 > - Can we reuse slot IDs of deleted records when these are intermixed
 > with those of records still in use? I presume that it any deleted
 > records cease to be referred to in the rest of the db, therefore
 > this shouldn't be a problem.

I'm not exactly sure what you mean by the qualification "when intermixed .."
but, yes, you can reuse RIDs and need not worry about stale record
references...

 > - Should all accesses to the buffer manager (to read pages, for
 > instance) be done through the MINIBASE_DB-> functions that then call BM
 > functions?

No, you reach the buffer manager through the MINIBASE_BM-> object (whose
allocation was the cause of some pain in the first assignment, but now 
you'll
be using the Minibase buffer mgr, so...), whose functions call the lower
level MINIBASE_DB-> object methods...

 > - DB->read_page(PageId pageno, Page* pageptr); returns a Page at
 > pageptr. Can this be cast as a HFPage?

Yes, you can, although as I mentioned, you do not call DB.  The buffer mgr
does all memory management (that is its reason for being there), so you
should call the appropriate functions, which take a reference to a pointer
(so you can simply declare an HFPage pointer and cast that to a ref to
ptr to Page when you pass it to the buf mgr methods).

 > - In a scan, how are we supposed to find out which one is the first
 > page? Can we convene that it will be the first record in the directory?

A scan only guarantees that you visit all records in the collection (entire
heap file or single heap file page).  Since no "natural order" is defined,
it is up to you do provide the order (ie. not just the first, but also the
next, etc).  So you probably do what comes more natural given your heapfile
implementation...

Hope this helps!
Spiros