Storage and File Structureالتخزين وبنية الملفات
مقدمة الفصل
ماذا ستتعلم في هذا الفصل
- Physical storage media, their classification and the storage hierarchy.
- Magnetic disks: structure, controller, subsystems, performance measures and block-access optimization.
- RAID: reliability via redundancy, performance via parallelism, RAID levels and choosing a level.
- File organization: fixed- and variable-length records, organization of records in files, the data dictionary.
- Storage access: blocks, the buffer manager and buffer-replacement policies.
أقسام الفصل
- 1Classification of physical storage mediaتصنيف وسائط التخزين المادية
- 2The storage hierarchyهرم التخزين
- 3Magnetic disks and disk subsystemsالأقراص المغناطيسية وأنظمتها
- 4Performance measures of disksمقاييس أداء الأقراص
- 5Optimizing disk-block accessتحسين الوصول إلى الكتل
- 6RAID: redundancy and parallelismRAID: التكرار والتوازي
- 7RAID levelsمستويات RAID
- 8Choosing a RAID level; hardware issuesاختيار مستوى RAID ومسائل العتاد
- 9File organization and recordsتنظيم الملفات والسجلات
- 10Organization of records in filesتنظيم السجلات في الملفات
- 11Storage access and the buffer managerالوصول إلى التخزين ومدير المخزن المؤقت
تلميح: استخدم أسهم لوحة المفاتيح للتنقل بين الشرائح.
Classifying storage mediaتصنيف الوسائط
Classification of physical storage media
Classified by (slide 3)
- speed of access
- cost per unit of data
- reliability
- Reliability covers data loss on power failure or system crash and physical failure of the storage device (slide 3).
- Main memory: fast access; capacities of up to a few gigabytes widely used currently; capacities have gone up and per-byte costs have decreased steadily and rapidly; volatile — contents are usually lost if a power failure or system crash occurs (slide 4).
- Flash memory: increasingly used as a replacement for magnetic disks for storing moderate amounts of data; writes are slow (few microseconds); widely used in embedded devices such as digital cameras, phones and USB keys (slide 5).
Volatileمتطاير
- Loses contents when power is switched off.
- Cache — fastest and most costly; managed by hardware.
- Main memory — fast, generally too small or too expensive for the whole database.
Non-volatileغير متطاير
- Contents persist when power is switched off.
- Secondary and tertiary storage, and battery-backed-up main memory.
- Flash memory — survives power failure; reads roughly as fast as main memory, writes slow, erase slower.
Disk, optical and tape storageالقرص والضوئي والشريط
Classification of physical storage media
| Mediumالوسيط | Key factsأهم الحقائق |
|---|---|
| Magnetic disk |
|
| Optical storage |
|
| Tape storage |
|
The storage hierarchyهرم التخزين
From fastest to slowest (slide 9)
- 1
Cache
- 2
Main memory
- 3
Flash memory
- 4
Magnetic disk
- 5
Optical disk
- 6
Magnetic tapes
| Levelالمستوى | Propertiesالخصائص | Examplesأمثلة |
|---|---|---|
| Primary storage | Fastest, volatile | Cache, main memory |
| Secondary (on-line) storage | Non-volatile, moderately fast | Flash memory, magnetic disks |
| Tertiary (off-line) storage | Non-volatile, slow | Magnetic tape, optical storage |
Magnetic disk structureبنية القرص
Magnetic disks and disk subsystems
Slides 11–12
- Slide 11 labels the parts of the disk mechanism: spindle, track t, sector s, cylinder c, platter, read–write head, arm, arm assembly, rotation (the diagram is schematic and simplifies actual disk drives).
- Read-write head: positioned very close to the platter surface (almost touching it); reads or writes magnetically encoded information.
- Typical sectors per track: 500 to 1000 (inner tracks) to 1000 to 2000 (outer tracks).
- To read/write a sector: the disk arm swings to position the head on the right track; the platter spins continually and data is read/written as the sector passes under the head.
- Head-disk assemblies: multiple platters on a single spindle (1 to 5 usually), one head per platter, mounted on a common arm.
A circular division of the platter surface (over 50K–100K per platter).
A division of a track — the smallest unit of data that can be read or written (typically 512 bytes).
The ith track of all the platters.
The disk controller (slide 13)
- Accepts high-level commands to read or write a sector, and moves the arm.
- Computes and attaches checksums to each sector to verify data is read back correctly.
- Ensures successful writing by reading back the sector after writing it.
- Performs remapping of bad sectors.
Slide 13
- Earlier generation disks were susceptible to head-crashes: metal-oxide coatings could disintegrate and damage all data on the disk; current disks are less susceptible, although individual sectors may get corrupted.
- If data is corrupted, with very high probability the stored checksum won't match the recomputed checksum.
Disk subsystems: SAN and NASSAN وNAS
Magnetic disks and disk subsystems
- Slide 14 draws a disk controller on the system bus with four disks attached: multiple disks connected to a computer system through a controller.
- Controller functionality (checksum, bad sector remapping) is often carried out by individual disks, reducing load on the controller.
- Interface families: ATA (AT adaptor), SATA (Serial ATA), SCSI (Small Computer System Interconnect), SAS (Serial Attached SCSI); several variants of each (different speeds and capabilities).
- Disks are usually connected directly to the computer system (slide 15).
Disk interface standards (slide 14)
- ATA
- SATA
- SCSI
- SAS
Storage Area Network (SAN)SAN
- A large number of disks connected by a high-speed network to a number of servers.
Network Attached Storage (NAS)NAS
- Networked storage that provides a file system interface using a networked file system protocol, instead of a disk system interface.
Disk performance measuresأداء القرص
Performance measures of disks
From when a read or write request is issued to when data transfer begins: seek time + rotational latency.
Time to reposition the arm over the correct track; average = 1/2 the worst case; 4 to 10 ms.
Time for the sector to appear under the head; average = 1/2 the worst case; 4 to 11 ms.
Rate at which data is retrieved from or stored to the disk; 25 to 100 MB/s max, lower for inner tracks.
Average time the disk runs continuously without failure; typically 3 to 5 years; decreases as the disk ages.
Slides 16–17
- Average seek time would be 1/3 of the worst case if all tracks had the same number of sectors, ignoring the time to start and stop arm movement.
- Rotational latency 4 to 11 ms on typical disks (5400 to 15000 r.p.m.).
- Multiple disks may share a controller, so the rate the controller can handle is also important: SATA 150 MB/sec, SATA-II 3Gb (300 MB/sec); Ultra 320 SCSI 320 MB/s, SAS 3 to 6 Gb/sec; Fiber Channel (FC2Gb or 4Gb) 256 to 512 MB/s.
- Probability of failure of new disks is quite low, corresponding to a "theoretical MTTF" of 500,000 to 1,200,000 hours for a new disk (slide 17).
المسألة
A new disk has an MTTF of 1,200,000 hours. What does this mean for 1000 relatively new disks? (slide 17)
المعطيات
- MTTF
- 1,200,000 hours
- Disks
- 1000
خطوات الحل
- 1,200,000 hours ÷ 1000 disks = 1200 hours.
النتيجة
On average, one disk will fail every 1200 hours.
Blocks and access optimizationتحسين الوصول
Optimizing disk-block access
A logical unit of a fixed number of contiguous sectors from a single track; data is transferred between disk and main memory in blocks (typically 4 to 16 KB).
Smaller blocksكتل أصغر
- More transfers from disk.
Larger blocksكتل أكبر
- More space wasted due to partially filled blocks.
- Block sizes range from 512 bytes to several kilobytes (slide 18).
- Elevator algorithm figure (slide 18): requests R6, R3, R1, R5, R2, R4 lie from the inner track to the outer track; the arm serves them sweeping toward the outer track, then back toward the inner track.
- Fragmentation: data inserted to/deleted from the file, or free blocks scattered so a new file has its blocks scattered — sequential access then means increased arm movement (slide 19).
- Non-volatile RAM: even if power fails, the data is safe and will be written to disk when power returns; the controller writes to disk when there are no other requests or a request has been pending for some time; database operations needing safe storage can continue without waiting (slide 20).
- A log disk is used exactly like nonvolatile RAM, with no need for special hardware (NV-RAM) (slide 20).
- Disk-arm scheduling (e.g., the elevator algorithm) orders pending accesses to minimize arm movement.
- Store related information on the same or nearby cylinders; fragmented files increase arm movement — defragment utilities help.
- Nonvolatile write buffers (battery-backed RAM or flash) make writes safe and fast; writes can be reordered.
- A log disk writes a sequential log of block updates — very fast since no seeks are required.
- Journaling file systems write in safe order; reordering without journaling risks corruption.
RAID: why and howRAID
RAID: redundancy and parallelism
Manage many disks as one disk of high capacity and high speed (disks in parallel) and high reliability (data stored redundantly). "I" originally meant inexpensive; today it is independent.
المسألة
100 disks, each with MTTF 100,000 hours (≈ 11 years). What is the MTTF of the whole system? (slide 21)
المعطيات
- Disks
- 100
- MTTF each
- 100,000 hours
خطوات الحل
- The chance that some disk out of N fails is much higher than for one specific disk.
- 100,000 hours ÷ 100 disks = 1000 hours.
النتيجة
System MTTF ≈ 1000 hours (about 41 days).
- Mirroring (shadowing): duplicate every disk; writes go to both, reads to either; data is lost only if a disk and its mirror both fail before repair — e.g., mean time to data loss of 500 × 10⁶ hours (57,000 years).
- Parallelism goals: load-balance small accesses (throughput) and parallelize large accesses (response time).
- Block-level striping: with n disks, block i goes to disk (i mod n) + 1. Bit-level striping (bit i of each byte to disk i) is not used much any more.
- Redundancy: store extra information that is not needed normally, but can be used in the event of failure of a disk to rebuild the lost information (slide 22).
- Mirroring: a logical disk consists of two physical disks; the combined-failure probability is very small except for dependent failure modes such as fire, building collapse or electrical power surges.
- Mean time to data loss depends on mean time to failure and mean time to repair: MTTF of 100,000 hours and mean time to repair of 10 hours give 500 × 10⁶ hours (57,000 years) for a mirrored pair (ignoring dependent failure modes).
- Bit-level striping: in an array of eight disks, each access can read data at eight times the rate of a single disk, but seek/access time is worse than for a single disk (slide 23).
- Block-level striping: requests for different blocks can run in parallel; a long sequence of blocks can use all disks in parallel (slide 23).
- RAID was originally a cost-effective alternative to large, expensive disks; today RAIDs are used for their higher reliability and bandwidth (slide 21).
RAID levelsمستويات RAID
| Levelالمستوى | Schemeالطريقة | Notesملاحظات |
|---|---|---|
| 0 |
| High-performance applications where data loss is not critical |
| 1 | Mirrored disks with block striping |
|
| 2 | Memory-style ECC with bit striping | Subsumed by level 3 |
| 3 | Bit-interleaved parity |
|
| 4 | Block-interleaved parity on a separate disk | Parity disk is a bottleneck for independent block writes |
| 5 | Block-interleaved distributed parity (all N + 1 disks) | Subsumes level 4 without the parity-disk bottleneck |
| 6 | P+Q redundancy |
|
- RAID levels: schemes to provide redundancy at lower cost by using disk striping combined with parity bits; different levels have differing cost, performance and reliability (slide 24).
- Slides 24–29 draw each level: (a) RAID 0 four disks; (b) RAID 1 four disks and four copies (C); (c) RAID 2 four disks and three parity disks (P); (d) RAID 3 four disks and one parity disk; (e) RAID 4 four disks and one parity disk; (f) RAID 5 five disks, each holding parity; (g) RAID 6 six disks with P and Q.
- RAID 3: faster data transfer than a single disk, but fewer I/Os per second since every disk participates in every I/O; subsumes level 2 (slide 26).
- RAID 4: higher I/O rates for independent block reads than level 3; high transfer rates for reads of multiple blocks; before writing a block, parity must be computed — from the old parity block, old and new value of the block (2 block reads + 2 block writes), or by recomputing from the new values of the blocks (more efficient for large sequential writes) (slide 27).
- RAID 5: higher I/O rates than level 4 — block writes occur in parallel if the blocks and their parity blocks are on different disks (slide 29).
- To recover a damaged disk/block in levels 3–5: compute the XOR of the corresponding bits/blocks of the other disks (including parity).
- Level 5 with 5 disks: the parity block of the nth set of blocks is on disk (n mod 5) + 1.
| Disk 1 | Disk 2 | Disk 3 | Disk 4 | Disk 5 |
|---|---|---|---|---|
| P0 | 0 | 1 | 2 | 3 |
| 4 | P1 | 5 | 6 | 7 |
| 8 | 9 | P2 | 10 | 11 |
| 12 | 13 | 14 | P3 | 15 |
| 16 | 17 | 18 | 19 | P4 |
Choosing a RAID levelاختيار المستوى
Factors in choosing a RAID level (slide 30)
- monetary cost
- performance (I/O operations per second, bandwidth)
- performance during failure
- performance during rebuild of failed disk
Rules (slides 30–31)
- RAID 0 only when data safety is not important.
- Levels 2 and 4 are never used — subsumed by 3 and 5. Level 3 is not used anymore. Level 6 is rarely used.
- Level 1: much better write performance than level 5 — level 5 needs at least 2 block reads + 2 block writes per block write; level 1 only 2 block writes. Preferred for high-update environments such as log disks.
- Level 5: preferred for applications with low update rate and large amounts of data; level 1 for all other applications.
- RAID 0 e.g. when data can be recovered quickly from other sources; level 3 is not used since bit-striping forces single block reads to access all disks; level 6 is rarely used since levels 1 and 5 offer adequate safety for most applications (slide 30).
- Level 1 had higher storage cost than level 5, but disk capacities grow rapidly (50%/year) while access times decreased much less (×3 in 10 years); I/O requirements have increased greatly (e.g. Web servers); when enough disks are bought for the I/O rate they often have spare capacity — so there is often no extra monetary cost for Level 1 (slide 31).
Replacement of a disk while the system is running, without power down.
Continually scan for latent failures (data written earlier that gets damaged) and recover from copy/parity.
Hardware issues (slides 32–33)
- Software RAID: implemented entirely in software, with no special hardware support. Hardware RAID: special hardware; uses non-volatile RAM to record writes being executed (slide 32).
- Beware: power failure during write can result in a corrupted disk (e.g. after writing one block but before the second in a mirrored system); corrupted data must be detected when power is restored — recovery is like recovery from a failed disk; NV-RAM helps detect potentially corrupted blocks efficiently, otherwise all blocks must be read and compared with mirror/parity (slide 32).
- Latent failures can result in data loss even if only one disk fails; hot swapping is supported by some hardware RAID systems and reduces time to recovery; many systems keep spare disks online to replace failed disks immediately; redundant power supplies with battery backup and multiple controllers and interconnections guard against single points of failure (slide 33).
Fixed-length records and free listsالسجلات الثابتة
File organization and records
- A database is a collection of files; a file is a sequence of records; a record is a sequence of fields.
- Record i starts at byte n × (i − 1) (n = record size); records may cross blocks — so do not allow records to cross block boundaries.
A collection of data stored in one unit, identified by a filename (slide 35).
A collection of related fields.
The basic unit of the data, which contains a single data value.
- 1CompactالضغطMove records i + 1, …, n to i, …, n − 1.
- 2Move the last recordنقل الأخيرMove record n to i.
- 3Free listالقائمة الحرةDo not move records; **link all free records on a free list**.
The file header stores the address of the first deleted record; that record stores the address of the second, and so on — the addresses act as pointers. More space efficient: reuse the free records' attribute space for the pointers.
Deleting a fixed-length record: the three alternativesحذف سجل
File organization and records
| Record | ID | name | dept_name | salary |
|---|---|---|---|---|
| record 0 | 10101 | Srinivasan | Comp. Sci. | 65000 |
| record 1 | 12121 | Wu | Finance | 90000 |
| record 2 | 15151 | Mozart | Music | 40000 |
| record 3 | 22222 | Einstein | Physics | 95000 |
| record 4 | 32343 | El Said | History | 60000 |
| record 5 | 33456 | Gold | Physics | 87000 |
| record 6 | 45565 | Katz | Comp. Sci. | 75000 |
| record 7 | 58583 | Califieri | History | 62000 |
| record 8 | 76543 | Singh | Finance | 80000 |
| record 9 | 76766 | Crick | Biology | 72000 |
| record 10 | 83821 | Brandt | Comp. Sci. | 92000 |
| record 11 | 98345 | Kim | Elec. Eng. | 80000 |
| Record | ID | name | dept_name | salary |
|---|---|---|---|---|
| record 0 | 10101 | Srinivasan | Comp. Sci. | 65000 |
| record 1 | 12121 | Wu | Finance | 90000 |
| record 2 | 15151 | Mozart | Music | 40000 |
| record 4 | 32343 | El Said | History | 60000 |
| record 5 | 33456 | Gold | Physics | 87000 |
| record 6 | 45565 | Katz | Comp. Sci. | 75000 |
| record 7 | 58583 | Califieri | History | 62000 |
| record 8 | 76543 | Singh | Finance | 80000 |
| record 9 | 76766 | Crick | Biology | 72000 |
| record 10 | 83821 | Brandt | Comp. Sci. | 92000 |
| record 11 | 98345 | Kim | Elec. Eng. | 80000 |
| Record | ID | name | dept_name | salary |
|---|---|---|---|---|
| record 0 | 10101 | Srinivasan | Comp. Sci. | 65000 |
| record 1 | 12121 | Wu | Finance | 90000 |
| record 2 | 15151 | Mozart | Music | 40000 |
| record 11 | 98345 | Kim | Elec. Eng. | 80000 |
| record 4 | 32343 | El Said | History | 60000 |
| record 5 | 33456 | Gold | Physics | 87000 |
| record 6 | 45565 | Katz | Comp. Sci. | 75000 |
| record 7 | 58583 | Califieri | History | 62000 |
| record 8 | 76543 | Singh | Finance | 80000 |
| record 9 | 76766 | Crick | Biology | 72000 |
| record 10 | 83821 | Brandt | Comp. Sci. | 92000 |
| Record | ID | name | dept_name | salary |
|---|---|---|---|---|
| header | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | → record 1 |
| record 0 | 10101 | Srinivasan | Comp. Sci. | 65000 |
| record 1 | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | → record 4 |
| record 2 | 15151 | Mozart | Music | 40000 |
| record 3 | 22222 | Einstein | Physics | 95000 |
| record 4 | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | → record 6 |
| record 5 | 33456 | Gold | Physics | 87000 |
| record 6 | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | لا تذكر الشرائح شيئًا هنا. | (end of list) |
| record 7 | 58583 | Califieri | History | 62000 |
| record 8 | 76543 | Singh | Finance | 80000 |
| record 9 | 76766 | Crick | Biology | 72000 |
| record 10 | 83821 | Brandt | Comp. Sci. | 92000 |
| record 11 | 98345 | Kim | Elec. Eng. | 80000 |
- No pointers are stored in in-use records (slide 39).
Variable-length records and slotted pagesالسجلات المتغيرة
File organization and records
Variable-length records (slide 40)
- Arise from multiple record types in a file, variable-length fields (varchar), and repeating fields.
- Variable-length attributes are stored as a fixed-size (offset, length), with the actual data after all fixed-length attributes.
- Null values are represented by a null-value bitmap.
| Bytes | Contents |
|---|---|
| 0–3 | (21, 5) — offset and length of the first variable-length attribute |
| 4–7 | (26, 10) |
| 8–11 | (36, 10) |
| 12–19 | 65000 |
| 20 | null bitmap 0000 |
| 21–25 | 10101 |
| 26–35 | Srinivasan |
| 36–45 | Comp. Sci. |
Slotted page structure (slide 41)
- The header holds the number of record entries, the end of free space in the block, and the location and size of each record.
- Records can be moved within the page to stay contiguous; the header entry is updated.
- Pointers point to the record's entry in the header, not directly to the record — this indirection lets records move without breaking pointers.
- Slide 41 figure: a block header with # Entries, End of Free Space and a (size, location) entry per record; free space in the middle; records at the end of the block, each header entry pointing to its record.
- Attributes are stored in order; variable-length records arise from repeating fields used in some older data models (slide 40).
- This level of indirection allows records to be moved to prevent fragmentation of space inside a block, while supporting indirect pointers to the record (slide 41).
Organizing records in filesتنظيم السجلات
Organization of records in files
A record can be placed anywhere in the file where there is space; no ordering.
Records stored in sequential order based on the value of the search key.
A hash function on some attribute specifies the block in which the record is placed.
Records of several different relations in the same file — related records on the same block to minimize I/O.
- Heap: typically there is a single file for each relation (slide 42).
- Sequential: suitable for applications that require sequential processing of the entire file; the records are ordered by a search-key (slide 43).
- Slide 43 draws the 12 instructor records in ID order, each pointing to the next; slide 44 inserts 32222 Verdi Music 48000 into an overflow block at the end and links it into the pointer chain.
Sequential file maintenance (slide 44)
- Deletion: use pointer chains.
- Insertion: insert at the right position if there is free space; otherwise in an overflow block; update the pointer chain.
- Reorganize the file from time to time to restore sequential order.
Multitable clustering: the exampleمثال التجميع
Organization of records in files
| dept_name | building | budget |
|---|---|---|
| Comp. Sci. | Taylor | 100000 |
| Physics | Watson | 70000 |
| ID | name | dept_name | salary |
|---|---|---|---|
| 10101 | Srinivasan | Comp. Sci. | 65000 |
| 33456 | Gold | Physics | 87000 |
| 45565 | Katz | Comp. Sci. | 75000 |
| 83821 | Brandt | Comp. Sci. | 92000 |
| dept_name / ID | building / name | budget / salary |
|---|---|---|
| Comp. Sci. | Taylor | 100000 |
| 45564 | Katz | 75000 |
| 10101 | Srinivasan | 65000 |
| 83821 | Brandt | 92000 |
| Physics | Watson | 70000 |
| 33456 | Gold | 87000 |
Multitable clustering and the data dictionaryالتجميع والقاموس
Organization of records in files
Good forجيد لـ
- Queries involving department ⋈ instructor.
- Queries involving one single department and its instructors.
Bad forسيئ لـ
- Queries involving only department.
- Results in variable size records (pointer chains can link records of one relation).
Stores metadata — data about data: names of relations and their attributes (names, types, lengths); views; integrity constraints; user and accounting information, including passwords; statistics (number of tuples in each relation); how and where each relation is stored; information about indices.
| Relation | Attributes |
|---|---|
| Relation_metadata | relation_name, number_of_attributes, storage_organization, location |
| Attribute_metadata | relation_name, attribute_name, domain_type, position, length — relation_name points to Relation_metadata |
| User_metadata | user_name, encrypted_password, group |
| Index_metadata | index_name, relation_name, index_type, index_attributes — relation_name points to Relation_metadata |
| View_metadata | view_name, definition |
Blocks, buffers and the buffer managerمدير المخزن المؤقت
Storage access and the buffer manager
- A database file is partitioned into fixed-length blocks — units of both storage allocation and data transfer.
- The goal: minimize the number of block transfers by keeping as many blocks as possible in main memory.
- Buffer: the portion of main memory storing copies of disk blocks. Buffer manager: the subsystem that allocates buffer space.
When a program requests a block (slide 50)
- 1
If the block is already in the buffer, return its address in main memory.
- 2
Otherwise allocate space, replacing another block if required; the replaced block is written back to disk only if it was modified.
- 3
Read the block from disk into the buffer and return its address.
- Programs call on the buffer manager when they need a block from disk (slide 50).
- The replaced block is written back to disk only if it was modified since the most recent time that it was written to/fetched from the disk (slide 50).
Buffer-replacement policiesسياسات الاستبدال
Storage access and the buffer manager
- Most operating systems replace the least recently used block (LRU) — the past pattern of references predicts future references.
- LRU can be a bad strategy for repeated scans of data, e.g., a nested-loops join (for each tuple of r, for each tuple of s …).
- A mixed strategy with hints from the query optimizer is preferable.
- Queries have well-defined access patterns (such as sequential scans), and a database system can use the information in a user's query to predict future references (slide 51).
- The nested loop of slide 51: for each tuple tr of r do / for each tuple ts of s do / if the tuples tr and ts match …
- The buffer manager can use statistical information regarding the probability that a request will reference a particular relation (slide 52).
A memory block that is not allowed to be written back to disk.
Frees the space of a block as soon as the final tuple of that block has been processed.
Pin the block being processed; after its final tuple it is unpinned and becomes the most recently used block (replaced first).
- Keep data-dictionary blocks in the buffer (they are frequently accessed).
- Buffer managers support forced output of blocks for recovery.
الخلاصة
أنهيت الدرس
الخطوة التالية: ثبّت المعلومات بالبطاقات، ثم اختبر نفسك بالأسئلة.
ما راجعته في هذا الدرس
- Classification of physical storage mediaتصنيف وسائط التخزين المادية
- The storage hierarchyهرم التخزين
- Magnetic disks and disk subsystemsالأقراص المغناطيسية وأنظمتها
- Performance measures of disksمقاييس أداء الأقراص
- Optimizing disk-block accessتحسين الوصول إلى الكتل
- RAID: redundancy and parallelismRAID: التكرار والتوازي
- RAID levelsمستويات RAID
- Choosing a RAID level; hardware issuesاختيار مستوى RAID ومسائل العتاد
- File organization and recordsتنظيم الملفات والسجلات
- Organization of records in filesتنظيم السجلات في الملفات
- Storage access and the buffer managerالوصول إلى التخزين ومدير المخزن المؤقت