ics321-20091029-queryeval

# ics321-20091029-queryeval - ICS 321 Fall 2009 Overview of...

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

ICS 321 Fall 2009 Overview of Query Evaluation Asst. Prof. Lipyeow Lim University of Hawaii at Manoa 10/29/2009 1 Lipyeow Lim -- University of Hawaii at Manoa

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

View Full Document
10/29/2009 Lipyeow Lim -- University of Hawaii at Manoa 2 Parse Query Enumerate Plans Estimate Cost Choose Best Plan Evaluate Query Plan Result Query SELECT * FROM Reserves WHERE sid=101 Sid=101 Reserves SCAN (sid=101) Reserves IDXSCAN (sid=101) Reserves Index(sid) fetch 32.0 25.0 Pick B A B Evaluate Plan A Optimizer
Query Processing Query Execution Plan (QEP): tree of database operators. At high-level, relational algebra operators are used At low-level, RA operators with particular implementation algorithm. Plan enumeration : find equivalent plans Different QEPs that return the same results Query rewriting : transformation of one QEP to another equivalent QEP. Cost estimation: a mapping of a QEP to a cost Cost Model: a model of what counts in the cost estimate. Eg. Disk accesses, CPU cost … Query Optimizer: Explores the space of equivalent plan for a query Chooses the best plan according to a cost model 10/29/2009 Lipyeow Lim -- University of Hawaii at Manoa 3

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

View Full Document
Access Paths An access path is a method of retrieving tuples. Eg. Given a query with a selection condition: File or table scan Index scan Index matching problem: given a selection condition, which indexes can be used for the selection, i.e., matches the selection ? Selection condition normalized to conjunctive normal form (CNF), where each term is a conjunct Eg. (day<8/9/94 AND rname =‘Paul’) OR bid=5 OR sid=3 CNF : (day<8/9/94 OR bid=5 OR sid=3 ) AND (rname =‘Paul’ OR bid=5 OR sid=3) 10/29/2009 Lipyeow Lim -- University of Hawaii at Manoa 4
Index Matching A tree index matches a selection condition if the selection condition is a prefix of the index search key. A hash index matches a selection condition if the

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 / 16

ics321-20091029-queryeval - ICS 321 Fall 2009 Overview of...

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

View Full Document
Ask a homework question - tutors are online