{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

7Index

# 7Index - INDEXING(CHAPTER 12 1 TOPICS Basic concepts...

This preview shows pages 1–12. Sign up to view the full content.

09/27/09 1 INDEXING (CHAPTER 12)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
09/27/09 2 TOPICS Basic concepts Hashing B + -tree
09/27/09 3 INTRODUCTION Review Conceptual Logical Physical E-R data model Relational data model SQL relation = a file Org. of records on a disk page Organization of attributes within a record Index Files

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
09/27/09 4 Software Architecture of a DBMS File System Buffer Pool Manager Abstraction of records Index structures Query Interpretor Query Optimizer Relational Algebra operators: , σ , ρ , δ , , , , ÷ , - Query Parser
09/27/09 5 Implementation of б Emp table: б Salary=30,000 (Employee) Process the select operator using a file scan (linear scan) F1 = Open the file corresponding to Employee P = read first page of F1 While P is not null For each record in P, if the record satisfies the selection predicate then produce as output P = read next page of F1 /* P becomes null when EoF is reached */ SS# Name Age Salary dno 1 Joe 24 20000 2 2 Mary 20 25000 3 3 Bob 22 27000 4 4 Kathy 30 30000 5 5 Shideh 4 4000 1 SS# Name Age Salary dno 4 Kathy 30 30000 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
09/27/09 6 Implementation of б Emp table: б Salary=30,000 (Employee) Process the select operator using a file scan (linear scan) F1 = Open the file corresponding to Employee P = read first page of F1 While P is not null For each record in P, if the record satisfies the selection predicate then produce as output P = read next page of F1 SS# Name Age Salary dno 1 Joe 24 20000 2 2 Mary 20 25000 3 3 Bob 22 27000 4 4 Kathy 30 30000 5 5 Shideh 4 4000 1 SS# Name Age Salary dno 4 Kathy 30 30000 5 Fetch the page from disk if not in the buffer pool
09/27/09 7 Implementation of б Emp table: б Salary=30,000 (Employee) Process the select operator using a file scan (linear scan) F1 = Open the file corresponding to Employee P = read first page of F1 While P is not null For each record in P, if the record satisfies the selection predicate then produce as output P = read next page of F1 SS# Name Age Salary dno 1 Joe 24 20000 2 2 Mary 20 25000 3 3 Bob 22 27000 4 4 Kathy 30 30000 5 5 Shideh 4 4000 1 SS# Name Age Salary dno 4 Kathy 30 30000 5 Header

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
09/27/09 8 TERMINOLOGY An exact match selection predicate: б Salary=30,000 (Employee) , б FirstName=“Shideh” (Employee) A range selection predicate: б Salary>30,000 (Employee) , б Salary<30,000 (Employee), б Salary>30,000 and Salary < 32,000 (Employee)
09/27/09 9 INTRODUCTION (Cont…) Motivation : Speed-up those queries that reference only a small portion of the records in a file. Analogy : Catalog cards in the library (more than one index). Evaluation : 1. Access time (find) 2. Insertion time (find + add) 3. Deletion time (find + delete) 4. Space overhead Search-key : The attribute (or set of attributes) used to lookup records in a file Primary index : The index whose search key specifies the sequential order of the records within a file. Secondary index : The index whose search key does not specify the sequential order of the records within a file.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
09/27/09 10 Indexing Mapping of records to a finite space using a function (computation) E.g., http://www.realmagic.net/dp/1-1.htm
09/27/09 11 K F(K) 10 10-1=9 11 11-2=9 12 12-3=9 13 13-4=9 14 14-5=9 15 15-6=9 16 16-7=9 17 17-8=9 18

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 59

7Index - INDEXING(CHAPTER 12 1 TOPICS Basic concepts...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online