[prev] 17 [next]

Single-file Storage Manager (cont)

Storage Manager data structures for opened DBs & Tables

typedef struct DBrec {
   char *dbname;   // copy of database name
   int fd;         // the database file
   SpaceMap map;   // map of free/used areas 
   NameMap names;  // map names to areas + sizes
} *DB;

typedef struct Relrec {
   char *relname;  // copy of table name
   int   start;    // page index of start of table data
   int   npages;   // number of pages of table data
   ...
} *Rel;