A database is a collection of large amount of related data. In case of RDBMS (Relational Database Management System), the data is stored in the form of relations or tables. As a normal user, we see the data stored in tables but actually this huge amount of data is stored in the form of files in physical memory.
A File is a collection of related records stored on the secondary storage such as magnetic disks in binary format. There are various strategies for mapping file records into blocks of disk:
1. Spanned Mapping:
In spanned mapping, the record of a file is stored inside the block even if it can only be stored partially and hence, the record is spanned over two blocks giving it the name Spanned Mapping.
- Advantages: No wastage of memory (no internal fragmentation).
- Disadvantages: The record which has been spanned, while accessing it we would be required to access two blocks and searching time of a block is greater than the searching time of a record inside a block as the number of blocks on the disk are too large.
2. Unspanned Mapping:
In unspanned mapping, unlike spanned strategy, the record of a file is stored inside the block only if it can be stored completely inside it.
- Advantages: Access time of a record is less. It is because in spanned mapping, for accessing the spanned record we were required to access two blocks and as we know accessing time of a block is much higher than that of a record. But in unspanned mapping, for a single record we need to access only a single block every time and hence, it is faster.
- Disadvantages: Wastage of memory is more (internal fragmentation).
- DBMS | Keys in Relational Model (Candidate, Super, Primary, Alternate and Foreign)
- Need for DBMS
- Commonly asked DBMS interview questions | Set 1
- DBMS | How to test if two schedules are View Equal or not ?
- Mapping from ER Model to Relational Model
- Commonly asked DBMS interview questions | Set 2
- DBMS | How to find the highest normal form of a relation
- DBMS | How to solve Relational Algebra problems for GATE
- DBMS | Concurrency Control -Introduction
- DBMS | Conflict Serializability
- DBMS | Nested Queries in SQL
- DBMS | Recoverability of Schedules
- Last Minute Notes - DBMS
- ACID Properties in DBMS
- DBMS Architecture 2-Level, 3-Level
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.