Create/Open index



next up previous
Next: Destroy index Up: Internal Design Previous: Data Structure

Create/Open index

When the index is created, the user is required to supply the name of the index, the length and AttrType of the key and the number of initial buckets. (Its default value is 1.) Then a new page is created (by Buffer Manager) as the RootPage and its PageId is given to db to set the file entry for the index. Then HeaderPage, DirPages and initial buckets are created and initialized.
When the index is opened, the user is required to supply the name of the index. Then the name is passed to db to get the PageId of RootPage. The RootPage is read into the buffer pool. The page number of HeaderPage is on the RootPage and from header page we can access all the pages in the index.



Weiqing Huang
Sun May 14 16:22:27 CDT 1995