- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
(数据库原理课件)Chapter12 Query Optimization教材课程.ppt
* * * * * * * * * * * * * * * * * * * * * * * Additional Optimization Techniques Top-K Queries Top-K queries select * from r, swhere r.B = s.Border by r.A ascendinglimit 10 Alternative 1: Indexed nested loops join with r as outer Alternative 2: estimate highest r.A value in result and add selection (and r.A = H) to where clause If 10 results, retry with larger H Optimization of Updates Halloween problem update R set A = 5 * A where A 10 If index on A is used to find tuples satisfying A 10, and tuples updated immediately, same tuple may be found (and updated) multiple times Solution 1: Always defer updates collect the updates (old and new values of tuples) and update relation and indices in second pass Drawback: extra overhead even if e.g. update is only on R.B, not on attributes in selection condition Solution 2: Defer only if required Perform immediate update if update does not affect attributes in where clause, and deferred updates otherwise. Join Minimization Join minimization select r.A, r.B from r, swhere r.B = s.B Check if join with s is redundant, drop it E.g. join condition is on foreign key from r to s, r.B is declared as not null, and no selection on s Other sufficient conditions possible select r.A, s2.B from r, s as s1, s as s2 where r.B=s1.B and r.B = s2.B and s1.A 20 and s2.A 10 join with s1 is redundant and can be dropped (along with selection on s1) Lots of research in this area since 70s/80s! Multiquery Optimization Example Q1: select * from (r natural join t) natural join s Q2: select * from (r natural join u) natural join s Both queries share common subexpression (r natural join s) May be useful to compute (r natural join s) once and use it in both queries But this may be more expensive in some situations e.g. (r natural join s) may be expensive, plans as shown in queries may be cheaper Multiquery optimization: find best overall plan for a set of queries, expoiting sharing of common subexpressions between qu
您可能关注的文档
- (振动理论课件)多自由度系统的振动-续(2nd)知识讲稿.ppt
- (振动理论课件)多自由度系统的振动B知识介绍.ppt
- (振动理论课件)振动理论绪论A教程文件.ppt
- (振动理论课件)振动系统及其力学模型A讲解材料.ppt
- (振动理论课件)线性系统的受迫振动-4讲解材料.ppt
- (振动理论课件)自激振动A讲解材料.ppt
- (振动理论课件)非线性振动概述知识讲稿.ppt
- (控制工程课件)CH2_控制系统的数学模型知识讲稿.ppt
- (控制工程课件)CH4_控制系统的频率特性教程文件.ppt
- (控制系统实验)1幻灯片课件.ppt
- (数据库原理课件)Chapter12 Security教学教材.ppt
- (数据库原理课件)Chapter13 Transaction教学教材.ppt
- (数据库原理课件)Chapter14 Concurrency教程文件.ppt
- (数据库原理课件)Chapter15 Recovery教材课程.ppt
- (数据库原理课件)Chapter2 Database System Development Lifecycle教材课程.ppt
- (数据库原理课件)Chapter2 The StayHome Case study知识介绍.ppt
- (数据库原理课件)Chapter3-1 Relational Theory教学教材.ppt
- (数据库原理课件)Chapter4 Conceptual Design宣讲培训.ppt
- (数据库原理课件)Chapter5 Normalization宣讲培训.ppt
- (数据库原理课件)Chapter6 Advanced database Design宣讲培训.ppt
文档评论(0)