Sei sulla pagina 1di 6

Overview of RDBMS

The figure shows the structure of a typical DBMS based on the relational data model.

The DBMS accepts SQL commands generated from various user interfaces, produces query evaluation plans, executes these plans against the database and returns the answers.

Database: Data Files - computer file which is used to store data Logs file which stores logging data which can be used to recover data in case of a crash Index files file which contains index data structure to speed up the retrieval of data Disk space Manager and I/O Manager: Disk space manager is used to manage the data and free space on the disk. The I/O manager manages the read and write of data on the disk. Buffer Manager: The buffer manager manages the functions for reading data or index pages from the database disk files into the buffer cache and writing modified pages back to disk. Example: Consider there are two tables namely emp and dept. In case of a Join operation, Select * from emp, dept where emp.id = dept.id We need to scan all the records in the department table for each record in the employee table to find the corresponding match. In order to increase the efficiency and for quick scanning, the buffer manager places the department records in the buffer cache. Record Manager: It uses the information in the log and manages the records in the disk. If a new column is added or deleted, the record manager updates the database. Indexer: It performs the indexing operation based on the attributes given for indexing. Example: In the emp table records are retrieved by specifying search attributes such as salary > 2000 or by name like Joe% Relational Operators: Basic relational operations can be performed with the following operations Union U

Intersection Difference Selection Projection Join Group by Order by Each of these has set semantics and bag semantics Set semantics returns unique set of records. Eg: select distinct(name) from emp Bag semantics returns duplicate records. Eg: select* from emp Plan Executor: - The plan executor devises a logical plan and runs the query based on that plan. - How to efficiently process a query, especially in large datasets ? Consider the following query Select * from employee,department where employee.deptid=department.deptid;

We have an employee table, department table and a hash join table.

Use the Scan operator to scan all the records in the employee table. Use the Index scan operator to scan the index structure of the department table. Get the deptid from employee table and use that to scan the department table. The satisfying records go into the hash join table and then flushed out to the output result screen. The above procedure is called Iterator model. This model involves three basic functions o Open() - open operator, used to open a table for scanning. o Close() - close operator, used to close a table. o getNext() - gets the next record from the table

The children(Scan and Index Scan) gives the records to the parent(Hash Join) and it might return the records to his parent. Query Parser: - Interprets the query and checks the syntax - It converts the query string to a logical plan Query Optimizer:

- Optimizes the logical plan, like doing a hash join or inner join, choosing whichever that is more efficient. - The optimized physical plan is passed to the plan executor. - How it optimizes? Depending upon the size of the dataset, it uses one of the following

Hash table join Nested loops Index structure scan

User Applications: - User that gives the query to retrieve the data records from the database - Eg:

Web Application eg:ODBC SQL Command Line

Disk Storage: -Advantages of disk over main memory


Large capacity Persistent storage Relatively cheap

-Disk Structure

-The above figure shows the structure of disk.


Data is stored on disk blocks which is made up of sectors Blocks are arranged on tracks which are in turn found in the platter Each platter has an unique address Set of all tracks with same diameter on the platter form a cylinder Disk head reads the data on the track to which it points to.

Potrebbero piacerti anche