Presentation is loading. Please wait.

Presentation is loading. Please wait.

What Should a DBMS Do? How will we do all this??

Similar presentations


Presentation on theme: "What Should a DBMS Do? How will we do all this??"— Presentation transcript:

1 What Should a DBMS Do? How will we do all this??
Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently and safely. Provide durability of the data. How will we do all this??

2 Generic Architecture Query User/ update Application Query compiler
Query execution plan Execution engine Record, index requests Index/record mgr. Page commands Buffer manager Read/write pages Storage manager storage

3 Query Optimization Goal: Declarative SQL query
Imperative query execution plan: buyer City=‘seattle’ phone>’ ’ SELECT S.sname FROM Purchase P, Person Q WHERE P.buyer=Q.name AND Q.city=‘seattle’ AND Q.phone > ‘ ’ (Simple Nested Loops) Buyer=name Purchase Person Plan: Tree of R.A. ops, with choice of alg for each op. Ideally: Want to find best plan. Practically: Avoid worst plans!

4 Alternate Plans Find names of people who bought telephony products  
buyer buyer Category=“telephony” Category=“telephony” (hash join) (hash join) prod=pname Buyer=name (hash join) (hash join) Product Buyer=name Person prod=pname Purchase Person Purchase Product But what if we’re only looking for Bob’s purchases?

5 ACID Properties Atomicity: all actions of a transaction happen, or none happen. Consistency: if a transaction is consistent, and the database starts from a consistent state, then it will end in a consistent state. Isolation: the execution of one transaction is isolated from other transactions. Durability: if a transaction commits, its effects persist in the database.

6 Problems with Transaction Processing
Airline reservation system: Step 1: check if a seat is empty. Step 2: reserve the seat. Bad scenario: (but very common) Customer 1 - finds a seat empty Customer 2 - finds the same seat empty Customer 1 - reserves the seat. Customer 2 - reserves the seat. Customer 1 will not be happy; spends night in airport hotel.


Download ppt "What Should a DBMS Do? How will we do all this??"

Similar presentations


Ads by Google