Data Storage and Querying
Data Storage and Querying
Generally the user interacts with the database management system through
an interface. The DBMS does the processing and retrieves the data from the
database.
Database system is divided into two modules,
1. Storage management
2. Query processing.
Data stored in database may costs more than trillion bytes of data. Main
memory cannot accommodate for such large amount of data, hence the data
is stored in disk. But for processing data needs to be transferred from disk to
the main memory. But this transfer consumes processor time; hence the
data needs to be arranged such that the data transfer rate is not too high.
This is taken care by storage manager.
The main task of database system is to provide the user with simplified view
of data. This is achieved by hiding the physical level implementation details
from the user, the user is provided with only high-level view.
Storage Management
, storage manager is responsible for storing, retrieving and modifying data
within the database. Storage manager consists of the following key
components,
(i) Transaction manger
(ii) File manager
(iii) Buffer manager.
(iv) Integrity manager
(v) Authorization manager.
(i) Transaction Manager: It manages the transactions so as to ensure that
data remain in consistent state even after the system failures. It also enables
the execution of concurrent transactions without any conflicts.
(ii) File Manager: It manages the process of allocating disk and data
structures that are used for representing the information saved on disk.
(iii) Buffer Manager: It handles the transfer of data from disk onto the main
memory and decides what data must be kept in main memory.
(iv) Integrity Manager: It verifies whether the integrity constraints defined
on the data are satisfied.
(v) Authorization Manager: It checks the authority of users and allows only
authorized users to access the data.
The following are the different data structures used by storage manager
a)Data Files
These are the files that contain the database.
(b) Data Dictionary
It maintains metadata regarding the different data structures used in
database.
(c) Indices
It provides fast access to the required data items.
1. Query Processor:
The Query Processor contains the following components:
a) DDL Interpreter: Interpreters DDL statements and
records the definition into data dictionary.
b) DML Compiler: Translates DML statements into an
evaluation plan consisting of low level instructions that the
query evaluation engine understands. It translates the
query into a number of evaluation plans. DML Compiler
performs query optimization