Unformatted text preview: ECS 165B: Database System Implementa6on Lecture 5 UC Davis April 7, 2010 Acknowledgements: por6ons based on slides by Raghu Ramakrishnan and Johannes Gehrke. Class Agenda Last 6me: Project-related logis6cs: subversion, code submission Finish indexing review; tree-structured indices in depth Today: Record Manager cookbook session Announcements Repositories online, team assignments straightened out Texbook now on reserve in Shields (2 copies, 1-day checkout) First discussion sec6on Friday @11am ScoX Adams on DavisDB Pt 1? Suggested Record File Architecture page 0 Page file header: *record size *1st full pageNo *1st pageNo with space *etc page 1 record (1,0) record (1,1) record (1,2) ... Page header: bitmap, next/ prev pageNo page 2 record (2,0) record (2,1) record (2,2) ... Page header: bitmap, next/ prev pageNo Layer 1: Unix file a sequence of bytes addressed by offset ... Layer 2: Page File (FileHandle)! a sequence of pages addressed by pageNo Layer 3: Record File (RecordFileHandle) a sequence of records addressed by (pageNo, slotNo) Suggested Record File Header Page Format record size pageNo of first page with free space pageNo of first page with no free space ... whatever else you want to record ... Suggested Data Page Format (cf. Lecture 2) record @ slot 1 record @ slot 2 free slots record @ slot 4 allocated records ... alloca6on bitmap : 0110100111000111...0 previous pageNo next pageNo header Suggested Scheme for Tracking Free Space in a Heap File Implemented as2) List a Record File (cf. Lecture Data Page Header Page Data Page Data Page Data Page Pages with Free Space Data Page Data Page Full Pages The header page id and Heap file name must Each data page contains two "pointers" (pageNo's) in addi6on to bitmap and someplace. be stored record contents Header page has "pointers" to first page in pluslist Each page contains 2 `pointers' each data.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 23 OK, Let's Try Wri6ng Some Code! ...
View Full Document
- Spring '10
- Database management system, Pages, pageNo