<> <> <> <> <> <> <> <> <> <> DIRECTORY DBCommon, DBStorage, DBStorageInternal, DBStoragePagetags; DBIndex: CEDAR DEFINITIONS = BEGIN RealIndexHandle: TYPE = REF IndexObject; IndexObject: TYPE = RECORD [ tid: DBStorageInternal.TID, segment: DBCommon.DBPage, -- segment in which the index lives rootDB: DBCommon.DBPage, -- NullDBPage iff the index is empty root: DBCommon.CacheHandle, -- always a hint depth: CARDINAL, -- 0 if the index is empty front, back: RealIndexHandle, -- for doubly linkded lists free: BOOLEAN -- TRUE iff it does not point to real index ]; IndexKey: TYPE = LONG POINTER TO KeyBody; KeyBody: TYPE = DBCommon.KeyBody; Page: TYPE = REF PageObject; PageObject: TYPE = RECORD [ tree: RealIndexHandle, db: DBCommon.DBPage, cache: DBCommon.CacheHandle, depth: CARDINAL, -- depth = 1 for leaf, >1 for non-leaf (0 for empty tree) pointer: LONG POINTER TO Core, -- points to the cached page free: BOOLEAN, -- so that this page object may be re-used front: Page, back: Page]; State: TYPE = {normal, split, merge, delete, deleteFromNextPage}; Core: TYPE = MACHINE DEPENDENT RECORD [ tag: DBStoragePagetags.PageHeader, -- =6 for Btree left, right: DBCommon.DBPage, size: CARDINAL, index: ARRAY [0..CoreIndexSize) OF CARDINAL]; <> <> <> <> <> <> <> ItemHandle: TYPE = LONG POINTER TO Item; Item: TYPE = MACHINE DEPENDENT RECORD [ value: LONG CARDINAL, length: CARDINAL, text: PACKED ARRAY [0..0) OF CHARACTER]; < pair.>> <> OverHead: CARDINAL = 6; FullPage: CARDINAL = DBCommon.WordsPerPage; HalfPage: CARDINAL = FullPage/2 - 2; CoreIndexSize: CARDINAL = FullPage - OverHead; <> InitializeIndex: PROCEDURE; <> <> CallAfterFinishTransaction: PROC [s: DBCommon.Segment]; END.--DBIndex CHANGE LOG Created by Suzuki on May 8, 1980 3:49 PM <> Re-created by Cattell on September 21, 1982 9:09 pm <> Changed halfPage from FullPage/2 to FullPage/2 - 2 to try to fix some boundary threshold problems on when to split and merge pages. by Cattell: June 22, 1982 10:32 am Changed RealIndexHandle and Page to be REFs. by Cattell: August 6, 1982 2:17 pm Changed by MBrown on December 2, 1982 2:35 pm <> Changed by MBrown on September 15, 1983 12:46 pm <> <<>> Changed by Willie-Sue on February 15, 1985 <> Changed by Donahue on March 3, 1986 7:46:30 am PST <>