DOC PREVIEW
UT Dallas CS 6360 - Ch19

This preview shows page 1-2-3-24-25-26-27-49-50-51 out of 51 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

PowerPoint PresentationIntroduction to Query Processing (1)Introduction to Query Processing (2)1. Translating SQL Queries into Relational Algebra (1)Translating SQL Queries into Relational Algebra (2)2. Algorithms for SELECT and JOIN Operations (1)Algorithms for SELECT and JOIN Operations (2)Algorithms for SELECT and JOIN Operations (3)Algorithms for SELECT and JOIN Operations (4)Algorithms for SELECT and JOIN Operations (5)Algorithms for SELECT and JOIN Operations (7)Algorithms for SELECT and JOIN Operations (8)Algorithms for SELECT and JOIN Operations (9)Algorithms for SELECT and JOIN Operations (10)Algorithms for SELECT and JOIN Operations (11)Algorithms for SELECT and JOIN Operations (12)Slide 17Slide 183. Algorithms for PROJECT and SET Operations (1)Algorithms for PROJECT and SET Operations (2)Algorithms for PROJECT and SET Operations (3)4. Implementing Aggregate Operations and Outer Joins (1)Implementing Aggregate Operations and Outer Joins (2)5. Using Heuristics in Query Optimization (1)Using Heuristics in Query Optimization (2)Using Heuristics in Query Optimization (3)Using Heuristics in Query Optimization (4)Using Heuristics in Query Optimization (5)Using Heuristics in Query Optimization (6)Slide 30Slide 31Using Heuristics in Query Optimization (9)Using Heuristics in Query Optimization (10)Using Heuristics in Query Optimization (11)Using Heuristics in Query Optimization (12)Using Heuristics in Query Optimization (13)Using Heuristics in Query Optimization (15)Using Heuristics in Query Optimization (16)8. Using Selectivity and Cost Estimates in Query Optimization (1)Using Selectivity and Cost Estimates in Query Optimization (2)Using Selectivity and Cost Estimates in Query Optimization (3)Using Selectivity and Cost Estimates in Query Optimization (4)Using Selectivity and Cost Estimates in Query Optimization (5)Using Selectivity and Cost Estimates in Query Optimization (6)Using Selectivity and Cost Estimates in Query Optimization (7)Using Selectivity and Cost Estimates in Query Optimization (8)Using Selectivity and Cost Estimates in Query Optimization (9)Using Selectivity and Cost Estimates in Query Optimization (10)9. Overview of Query Optimization in Oracle10. Semantic Query OptimizationSummaryCopyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-WesleyChapter 19Algorithms for Query Processing and OptimizationCopyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Query Processing (1)Copyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Query Processing (2)Query optimization:The process of choosing an efficient execution strategy for processing a query.Two internal representations of a query:Query TreeQuery GraphCopyright © 2011 Ramez Elmasri and Shamkant Navathe1. Translating SQL Queries into Relational Algebra (1)Query block: The basic unit that can be translated into the algebraic operators and optimized.A query block contains a single SELECT-FROM-WHERE expression, as well as GROUP BY and HAVING clause if these are part of the block.Nested queries within a query are identified as separate query blocks.Aggregate operators in SQL must be included in the extended algebra.Copyright © 2011 Ramez Elmasri and Shamkant NavatheTranslating SQL Queries into Relational Algebra (2)SELECT LNAME, FNAMEFROM EMPLOYEEWHER E SALARY > ( SELECT MAX (SALARY)FROM EMPLOYEEWHER E DNO = 5);SELECT MAX (SALARY)FROM EMPLOYEEWHERE DNO = 5SELECT LNAME, FNAMEFROM EMPLOYEEWHERE SALARY > CπLNAME, FNAME (σSALARY>C(EMPLOYEE)) ℱMAX SALARY (σDNO=5 (EMPLOYEE))Copyright © 2011 Ramez Elmasri and Shamkant Navathe2. Algorithms for SELECT and JOIN Operations (1)Implementing the SELECT OperationExamples:(OP1):  SSN='123456789' (EMPLOYEE)(OP2):  DNUMBER>5(DEPARTMENT)(OP3):  DNO=5(EMPLOYEE)(OP4):  DNO=5 AND SALARY>30000 AND SEX=F(EMPLOYEE)(OP5):  ESSN=123456789 AND PNO=10(WORKS_ON)Copyright © 2011 Ramez Elmasri and Shamkant NavatheAlgorithms for SELECT and JOIN Operations (2)Implementing the SELECT Operation (contd.):Search Methods for Simple Selection:S1 Linear search (brute force):Retrieve every record in the file, and test whether its attribute values satisfy the selection condition.S2 Binary search:If the selection condition involves an equality comparison on a key attribute on which the file is ordered, binary search (which is more efficient than linear search) can be used. (See OP1).S3 Using a primary index or hash key to retrieve a single record:If the selection condition involves an equality comparison on a key attribute with a primary index (or a hash key), use the primary index (or the hash key) to retrieve the record.Copyright © 2011 Ramez Elmasri and Shamkant NavatheAlgorithms for SELECT and JOIN Operations (3)Implementing the SELECT Operation (contd.):Search Methods for Simple Selection:S4 Using a primary index to retrieve multiple records:If the comparison condition is >, ≥, <, or ≤ on a key field with a primary index, use the index to find the record satisfying the corresponding equality condition, then retrieve all subsequent records in the (ordered) file. S5 Using a clustering index to retrieve multiple records:If the selection condition involves an equality comparison on a non-key attribute with a clustering index, use the clustering index to retrieve all the records satisfying the selection condition.S6 Using a secondary (B+-tree) index:On an equality comparison, this search method can be used to retrieve a single record if the indexing field has unique values (is a key) or to retrieve multiple records if the indexing field is not a key.In addition, it can be used to retrieve records on conditions involving >,>=, <, or <=. (FOR RANGE QUERIES)Copyright © 2011 Ramez Elmasri and Shamkant NavatheAlgorithms for SELECT and JOIN Operations (4)Implementing the SELECT Operation (contd.):Search Methods for Simple Selection:S7 Conjunctive selection:If an attribute involved in any single simple condition in the conjunctive condition has an access path that permits the use of one of the methods S2 to S6, use that condition to retrieve the records and then check whether each retrieved record satisfies the remaining simple conditions in the conjunctive condition.S8 Conjunctive selection using a composite indexIf two or more attributes are involved in equality conditions in the conjunctive condition and a


View Full Document

UT Dallas CS 6360 - Ch19

Documents in this Course
Ch22(1)

Ch22(1)

44 pages

Ch21

Ch21

38 pages

Ch19

Ch19

46 pages

Ch18

Ch18

25 pages

Ch17

Ch17

21 pages

Ch15

Ch15

42 pages

Ch09

Ch09

42 pages

Ch05

Ch05

34 pages

Ch22

Ch22

45 pages

Ch21

Ch21

38 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch16

Ch16

17 pages

Ch15

Ch15

42 pages

Ch09

Ch09

42 pages

Ch08

Ch08

39 pages

Ch07

Ch07

34 pages

Ch06

Ch06

43 pages

Ch05

Ch05

34 pages

Ch04

Ch04

39 pages

Ch03(2)

Ch03(2)

36 pages

Ch02

Ch02

33 pages

Ch08

Ch08

28 pages

Ch07

Ch07

31 pages

Ch06

Ch06

43 pages

Ch05

Ch05

39 pages

Ch04(1)

Ch04(1)

39 pages

Ch03(1)

Ch03(1)

38 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch24

Ch24

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch03(1)

Ch03(1)

38 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch24

Ch24

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch08

Ch08

28 pages

Ch07

Ch07

31 pages

Ch06

Ch06

43 pages

Ch05

Ch05

39 pages

Ch04(1)

Ch04(1)

39 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

lab-manual

lab-manual

215 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch17

Ch17

25 pages

Ch21

Ch21

54 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch04(1)

Ch04(1)

43 pages

Ch07

Ch07

40 pages

Ch03

Ch03

42 pages

Ch01

Ch01

36 pages

Ch02

Ch02

38 pages

Ch05

Ch05

41 pages

Ch06

Ch06

47 pages

Ch08

Ch08

39 pages

Ch17

Ch17

25 pages

Ch18

Ch18

24 pages

Ch09

Ch09

42 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

Ch09

Ch09

42 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04(1)

Ch04(1)

43 pages

Ch03

Ch03

42 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Load more
Download Ch19
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Ch19 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Ch19 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?