- 1、本文档共30页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
15. Query Optimization.ppt
15. Query Optimization System Design Parsing Examples Modern Optimizers EXPLAIN – the output of an optimizer Overview of internals Dynamic programming VP – view the internals Examples Variants Top Down Optimization Optimizer Hints Unnesting Queries Learning Objectives Explain EXPLAIN Explain VP’s output Explain each variant Flatten a nested query. Overview of Query Processing Now we focus on the top of this diagram Detail of the top Parsing and Optimization The Parser Verifies that the SQL query is syntactically correct, that the tables and attributes exist, and that the user has the appropriate permissions. Translates the SQL query into a simple query tree (operators: relational algebra plus a few other ones) The Optimizer: Generates other, equivalent query trees (Actually builds these trees bottom up) For each query tree generated: Selects algorithms for each operator (producing a query plan) estimates the cost of the plan Chooses the plan with lowest cost (of the plans considered, which is not necessarily all possible plans) Schema for Examples Download Postgres source from /download Logical and physical schema is at src/test/bench/create.source Simplified version is at /587/create.bench Log into the database at /pgCS587/ Click on PostgreSQL User CS587, Password 587dbms, see notes view Browse the tables, especially tenk1 and its attributes unique1, unique2, stringu1 Here’s what the parser does Practice: Parse a Query Describe the parsers output when the input is SELECT stringu2 FROM tenk1 JOIN tenk2 USING unique1 WHERE tenk1.stringu1=abc; How Can We View the Optimizer? Postgres calls its optimizer the Planner Postgres planner algorithm [668] is the same as all modern DBMSs optimizer algorithms Except SQL Server We have good news and good news. We can see both the planners output AND its internal processing. Its output is available to anyone; its internal processing is avaliable only to us and a few others. The output is displayed by the EXPL
您可能关注的文档
- 构造正规表达式的 NFA1 ( 0 1 ) 1 0 1.ppt
- §3 平面曲线的弧长.ppt
- §5.6 平面向量的数量积及运算律.ppt
- 04152010.ppt
- 1-1 不等关系.ppt
- 1. How to grow old2. In some societies people want children.ppt
- 1.1千米的50%就是50%千米。2.一条带鱼重0.3千克,.ppt
- 1.3.4 两直线的相对位置.ppt
- 1.尝试描述碳酸氢铵的实验现象.ppt
- 14-15 May, 2002.ppt
- 第18讲 第17课 西晋的短暂统一和北方各族的内迁.docx
- 第15讲 第14课 沟通中外文明的“丝绸之路”.docx
- 第13课时 中东 欧洲西部.doc
- 第17讲 第16 课三国鼎立.docx
- 第17讲 第16课 三国鼎立 带解析.docx
- 2024_2025年新教材高中历史课时检测9近代西方的法律与教化含解析新人教版选择性必修1.doc
- 2024_2025学年高二数学下学期期末备考试卷文含解析.docx
- 山西版2024高考政治一轮复习第二单元生产劳动与经营第5课时企业与劳动者教案.docx
- 第16讲 第15课 两汉的科技和文化 带解析.docx
- 第13课 宋元时期的科技与中外交通.docx
文档评论(0)