1 / 16

CS 4432 Database Systems II Lecture 1: Introduction

CS 4432 Database Systems II Lecture 1: Introduction. A Brief Pre-amble. Relations. Statements. Results. Implementing a Database System? Simple?. Naïve Implementation. Relations stored in files (ASCII) e.g., relation Students is in /usr/db/Students. Students. Depts. Smith # 123 # CS

hammer
Download Presentation

CS 4432 Database Systems II Lecture 1: Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. A Brief Pre-amble Notes 1

  3. Relations Statements Results Implementing a Database System? Simple? 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 . . . . 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 . . . 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 Notes 1

  7. Simple Query 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 Notes 1

  8. Yet Another Execution • To execute “select A,B from R,S where condition”: (1) Read dictionary to get Students and also 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 Notes 1

  9. What’s wrong ? Notes 1

  10. 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 Notes 1

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

  12. 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? Notes 1

  13. 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? Notes 1

  14. 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 Notes 1

  15. 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 … Notes 1

  16. Any Questions? Notes 1

More Related