【正文】
ord 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. File Organization ? The database is stored as a collection of files. Each file is a sequence of records. A record is a sequence of fields. ? One approach: ?assume record size is fixed ?each file has records of one particular type only ?different files are used for different relations This case is easiest to implement。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. BufferReplacement Policies ? Most operating systems replace the block least recently used (LRU strategy) ? Idea behind LRU – use past pattern of block references as a predictor of future references ? Queries have welldefined access patterns (such as sequential scans), and a database system can use the information in a user’s query to predict future references ? LRU can be a bad strategy for certain access patterns involving repeated scans of data ? For example: when puting the join of 2 relations r and s by a nested loops for each tuple tr of r do for each tuple ts of s do if the tuples tr and ts match … ? Mixed strategy with hints on replacement strategy provided by the query optimizer is preferable 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Storage Access(存儲訪問) ? A database file is partitioned into fixedlength storage units called blocks. Blocks are units of both storage allocation and data transfer. ? Database system seeks to minimize the number of block transfers between the disk and memory. We can reduce the number of disk accesses by keeping as many blocks as possible in main memory. ? Buffer – portion of main memory available to store copies of disk blocks. ? Buffer manager – subsystem responsible for allocating buffer space in main memory. 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Storage Hierarchy (Cont.) 存儲分級 ? primary storage: 主存 ,快 ,易逝 ? secondary storage: next level in hierarchy, nonvolatile, moderately fast access time ? also called online storage ? . flash memory, magic disks 閃存,磁盤 ? tertiary storage: lowest level in hierarchy, nonvolatile, slow access time 第 3存儲 ? also called offline storage ? . magic tape, optical storage 磁帶光盤 169。Silberschatz, Korth and Sudarshan Database System Concepts 5th Edition, Oct 23, 2022. Physical Storage Media (Cont.) ? Tape storage 磁帶 ? nonvolatile, used primari