ics321-20091029-queryeval

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 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
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online