白色IT商务企划:数据库工程师工作分析SQLQueryO.pptx

白色IT商务企划:数据库工程师工作分析SQLQueryO.pptx

  1. 1、本文档共77页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
David J. DeWitt Microsoft Jim Gray Systems Lab Madison, Wisconsin dewitt@ ;2;Day 3;How About a Quiz to Start!;;;Anonymous Quote;The Role of the Query Optimizer (100,000 ft view);What’s the Magic?;Some Historical Background;;A First Example;Query Plan #1;Query Plan #2;Which Plan Will be Faster?;A Slightly More Complex Query;Enumerate logically equivalent plans by applying equivalence rules;Equivalence Rules;Equivalence Rules (cont.);Example of Equivalent Logical Plans;Five Logically “Equivalent” Plans;Four More!;9 Logically Equivalent Plans, In Total;Enumerate logically equivalent plans by applying equivalence rules;Physical Plan Example;Enumerate logically equivalent plans by applying equivalence rules;Selectivity Estimation;Histogram Motivation;Equi-Width Histogram Example;Equi-Height Histograms;Example #2: Predicate: CID = 6 Actual Sel. Factor = 157/939 = .167 Estimated Sel. Factor = (157/1)/993 = .167 ;;Enumerate logically equivalent plans by applying equivalence rules;Estimating Costs;An Example;Plan #1;Plan #2;But …;Estimating Join Costs;Sort-Merge Join Algorithm;Nested-Loops Join ;Main Idea: Scan R, and for each tuple in R probe tuples in M (by probing its index). Output result tuples.;Estimating Result Cardinalities;This is Why!;Multidimensional Histograms;A Little Bit About Estimating Join Cardinalities; General case: join on {A} (where {A} is key for neither) estimate each tuple r of R generates uniform number of matches in S and each tuple s of S generates uniform number of matches in R, e.g. SF = min(||R|| * ||S|| / NKeys(A,S) ||S|| * ||R|| / NKeys(A,R)) e.g., SELECT M.title, R.title FROM Movies M, Reviews R WHERE M.title = R.title Movies: 100 tuples, 75 unique titles ? 1.3 rows for each title Reviews: 20 tuples, 10 unique titles ? 2 rows for each title ;Enumerate logically equivalent plans by applying equivalence rules;Two Common Query “Shapes”;Pruning the Plan Space;;52;53;Two Relation Plans Starting With A;Two Rela

文档评论(0)

文单招、专升本试卷定制 + 关注
官方认证
服务提供商

专注于研究生产单招、专升本试卷,可定制

版权声明书
用户编号:8005017062000015
认证主体莲池区远卓互联网技术工作室
IP属地上海
统一社会信用代码/组织机构代码
92130606MA0G1JGM00

1亿VIP精品文档

相关文档