HeapFileUse single page to store a table structureCREATETABLE student (studentid INTEGER, name VARCHAR(1o),ageINTEGER, schoolidINTEGER);TableInfo:TableID:2B,Numofcolumns:2B,Numoftuples:4B,FirstpageID:4BNum of pages: 4B, Table name:1oBEachField:ColumnName:2B,Columntype:2B,Columnsize:2B,Notnull:1BKey:1BOffset:2B,Indexinfo:4BInthetablestructurepage:00000000h:01000400OA000000050000000100000073747564656E74000000737475646500000010h:6Estuden00000020h:74696400010004000101000000000000106E616D6500000000000200OA00010000000030h:0061040000000000650000000000000000000040h:67000104000000OE00000000007363686F00000050h:6F6c6964000001000400000012000000000060h:00olic00 0000000070h:
Use single page to store a table structure CREATE TABLE student (studentid INTEGER, name VARCHAR(10), age INTEGER, schoolid INTEGER); Table Info: Table ID: 2B, Num of columns: 2B, Num of tuples: 4B, First page ID: 4B Num of pages: 4B, Table name: 10B Each Field: Column Name: 2B, Column type: 2B, Column size: 2B, Not null: 1B Key: 1B Offset: 2B, Index info: 4B In the table structure page:
HeapFileStore the table contentAssume a tuple (123,"Zhang",20,45) is stored in Page 500000010h:7B0000005A68616E6700000000001400:...Zhang00000020h:00002D000000The unique identification (RID) of this tuple is defined by its page (5)and itsoffsetinthepage(oxo1oh)Uselinkedmultiplepages to storeall tuples inatableStructurePageGlobal BitmapContentContentContentContentPageiPage2Page3Pagen
Store the table content ▪ Assume a tuple (123,“Zhang”,20,45) is stored in Page 5 ▪ The unique identification (RID) of this tuple is defined by its page (5) and its offset in the page (0x010h) ▪ Use linked multiple pages to store all tuples in a table Content Page 1 Content Page 2 Content Page 3 Content Page n . Structure Page Global Bitmap