Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 4432 Database Systems II Lecture 1: Introduction

Similar presentations


Presentation on theme: "CS 4432 Database Systems II Lecture 1: Introduction"— Presentation transcript:

1 CS 4432 Database Systems II Lecture 1: Introduction
Notes 1

2 A Brief Pre-amble CS4432 Notes 1

3 Implementing a Database System? Simple?
Relations Statements Results CS4432 Notes 1

4 Naïve Implementation Relations stored in files (ASCII)
e.g., relation Students is in /usr/db/Students Students Depts Smith # 123 # CS Jones # 522 # EE CS # Fuller Labs EE # Atwater Kent PH # Olin Hall . . CS4432 Notes 1

5 Naïve Implementation Details
Directory file (ASCII) in /usr/db/schema Students#name#STR#id#INT#dept#STR Depts#name#STR#office#STR . . . CS4432 Notes 1

6 Sample Query select Students.name,Depts.office from Students,Depts
where Students.dept = Depts.name and Students.id > 300 # Smith # 123 # CS # CS # Fuller Labs Smith # 123 # CS # EE # Atwater Kent Smith # 123 # CS # PH # Olin Hall Jones # 522 # EE # CS # Fuller Labs Jones # 522 # EE # EE # Atwater Kent Jones # 522 # EE # PH # Olin Hall CS4432 Notes 1

7 Execution Process To execute “select * from R where condition”:
(1) Read dictionary to get R attributes (2) Read R file, for each line: (a) Check condition (b) If OK, display CS4432 Notes 1

8 Yet Another Execution To execute “select A,B from R,S where condition”: (1) Read dictionary to get Students,Depts attributes (2) Read Students file, for each line: (a) Read Depts file, for each line: (i) Create join tuple (ii) Check condition (iii) Display if OK CS4432 Notes 1

9 What’s wrong ? Layout ? Tuple layout on disk Example:
- Change string from ‘Cat’ to ‘Cats’ and we have to rewrite file - ASCII storage is expensive - Deletions are expensive CS4432 Notes 1

10 What’s wrong ? Search ? Search expensive; no indexes
e.g., - Cannot find tuple with given key quickly - Always have to read full relation CS4432 Notes 1

11 What’s wrong ? Brute force query processing e.g., select * from R,S
where R.A = S.A and S.B > 1000 - Do select first? - More efficient join? CS4432 Notes 1

12 What else is wrong ? Missing ?
No buffer manager : Need caching No concurrency control: Multiple users access and modify same data ? No reliability: lose data? leave operations half done ? No security: -File system insecure? Too coarse security? CS4432 Notes 1

13 System Structure Strategy Selector Query Parser User User Transaction
Transaction Manager Concurrency Control Buffer Manager Recovery Manager Lock Table File Manager M.M. Buffer Log Statistical Data Indexes User Data System Data CS4432 Notes 1

14 Course Overview File & System Structure
Records in blocks, dictionary, buffer management,… Indexing & Hashing B-Trees, hashing,… Query Processing Query costs, join strategies,… Crash Recovery Failures, stable storage,… Concurrency Control Correctness, locks,… Transaction Processing Logs, deadlocks,… Additional Topics If time permits … CS4432 Notes 1

15 Next time: The lowest layer : Brief look at hardware
Start to look at chapter 13 CS4432 Notes 1


Download ppt "CS 4432 Database Systems II Lecture 1: Introduction"

Similar presentations


Ads by Google