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).
- Mapping from ER Model to Relational Model
- Advantages of DBMS over File system
- File Organization in DBMS | Set 4
- File Organization in DBMS | Set 1
- File Organization in DBMS | Set 3
- Strategies for Schema design in DBMS
- Difference between DDL and DML in DBMS
- What is Database ?
- What is Stored Procedures in SQL ?
- Introduction to Graph Databases
- Difference between RDBMS and MongoDB
- What is Cursor in SQL ?
- Apache Cassandra (NOSQL database)
- What is Temporary Table in SQL?
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.