【正文】
re n is the size of each record. ? Record access is simple but records may cross blocks ? Modification: do not allow records to cross block boundaries ? Deletion of record i: alternatives: ? move records i + 1, . . ., n to i, . . . , n – 1 ? move record n to i ? do not move records, but link all free records on a free list 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. ? 記錄在頁(yè)面內(nèi)移動(dòng),頭文件中信息相應(yīng)修改( 可多次寫的光盤 是采用 另寫目錄 ) ? 外界的指針應(yīng)該指向 文件頭中的固定位置 ? 而不應(yīng)該指向具體的(可能會(huì)變的)記錄位置 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Sequential File Organization (Cont.) ? 刪除 – use pointer chains ? 插入 – 有縫插針 ,無(wú)縫 鏈溢 overflow block,更新指針 ? 與時(shí)俱進(jìn) 重排序 reanize time to time to restore sequential order 無(wú)縫鏈溢 ( 溢出塊) 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Chapter 11: Storage and File Structure 小結(jié) ? Overview of Physical Storage Media 物理存儲(chǔ)介質(zhì) ? Magic Disks 磁盤 ? RAID 磁盤陣列 ? Tertiary Storage 第三存儲(chǔ) ? Storage Access 存取 ? File Organization 文件結(jié)構(gòu) ? Organization of Records in Files 記錄結(jié)構(gòu) ? DataDictionary Storage 數(shù)據(jù)字典 。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Clustering File Organization 聚簇文件 ? 不同型但相關(guān)的數(shù)據(jù)放在一起 (舊式大家庭: 幾代同堂 ) ? ., clustering anization of customer and depositor: ? 作這兩各關(guān)系連接時(shí),快 ? results in variable size records 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Organization of Records in Files 記錄組織 :堆,順序,散列 ,聚簇 ? Heap – a record can be placed anywhere in the file where there is space 無(wú)序 , 堆, 插入策略 :無(wú)縫堆后,有縫插針, ? Sequential – store records in sequential order, based on the value of the search key of each record, 有序 ? Hashing – 影院分單雙號(hào) Hash(X)= X mod 2,入座時(shí)搜索空間減半 ? 寶光寺:數(shù)羅漢 . ? Hash(Person, sex)=2*(RedomSeed+Age+1)+Sex ? clustering file anization 不同型記錄可放一文件內(nèi),把相關(guān)記錄(父子兄弟等,經(jīng)常同時(shí)檢索的)放在同一個(gè)磁盤塊, 減少磁盤 IO,快 ? 注意 內(nèi)存比磁盤快 10—100倍, 減少讀塊 次數(shù) 是速度關(guān)鍵 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. VariableLength Records ? Variablelength records arise in database systems in several ways: ? Storage of multiple record types in a file. ? Record types that allow variable lengths for one or more fields. ? Record types that allow repeating fields (used in some older data models). 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. File Or