- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
(数据库原理课件)Chapter11 Query Processing教材课程.ppt
(1) Nested-Loop Join To compute the theta join r ? sfor each tuple tr in r do begin for each tuple ts in s do begin test pair (tr,ts) to see if they satisfy the join condition ? if they do, add tr ? ts to the result. endend r is called the outer relation and s the inner relation of the join. Requires no indices and can be used with any kind of join condition. Expensive since it examines every pair of tuples in the two relations. Nested-Loop Join (Cont.) In the worst case, if there is enough memory only to hold one block of each relation, the estimated cost is nr ? bs + br block transfers, plus nr + br seeks If the smaller relation fits entirely in memory, use that as the inner relation. Reduces cost to br + bs block transfers and 2 seeks Nested-Loop Join (Cont.) ? Number of records of student: nstudent = 5, 000. ? Number of blocks of student: bstudent = 100. ? Number of records of takes: ntakes = 10, 000. ? Number of blocks of takes: btakes = 400. Assuming worst case memory availability cost estimate is with student as outer relation: 5000 ? 400 + 100 = 2,000,100 block transfers, 5000 + 100 = 5100 seeks with takes as the outer relation 10000 ? 100 + 400 = 1,000,400 block transfers and 10,400 seeks If smaller relation (student) fits entirely in memory, the cost estimate will be 500 block transfers. Block nested-loops algorithm (next slide) is preferable. (2) Block Nested-Loop Join Variant of nested-loop join in which every block of inner relation is paired with every block of outer relation. for each block Br of r do begin for each block Bs of s do begin for each tuple tr in Br do begin for each tuple ts in Bs do begin Check if (tr,ts) satisfy the join condition if they do, add tr ? ts to the result. end end end end Block Nested-Loop Join (Cont.) Worst case estimate: br ? bs + br block transfers + 2 * br seeks Each block in the inner relation s is read once
您可能关注的文档
- (振动理论课件)多自由度系统的振动-续(2nd)知识讲稿.ppt
- (振动理论课件)多自由度系统的振动B知识介绍.ppt
- (振动理论课件)振动理论绪论A教程文件.ppt
- (振动理论课件)振动系统及其力学模型A讲解材料.ppt
- (振动理论课件)线性系统的受迫振动-4讲解材料.ppt
- (振动理论课件)自激振动A讲解材料.ppt
- (振动理论课件)非线性振动概述知识讲稿.ppt
- (控制工程课件)CH2_控制系统的数学模型知识讲稿.ppt
- (控制工程课件)CH4_控制系统的频率特性教程文件.ppt
- (控制系统实验)1幻灯片课件.ppt
- (数据库原理课件)Chapter12 Query Optimization教材课程.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
最近下载
- 医学三基考试(康复科)题库及答案(最新版).docx
- 学生调换宿舍申请表(模板).pdf VIP
- 陆上石油天然气开采安全规程.pdf VIP
- 综合与实践 探秘曹冲称象第2课时 活动二 课件 2025-2026学年度西师大版数学三年级上册.pptx VIP
- 国开电大 机电控制与可编程序控制器技术 形考任务1-3答案.doc VIP
- 钢管桩施工方案.doc VIP
- 2025凉山州继续教育公需科目满分答案-数字时代的心理健康.docx VIP
- 湘教(2024)八上数学综合与实践:空瓶换汽水.pptx VIP
- 智启未来,育见新篇——AI赋能教育教学的探索 课件.pptx VIP
- 2025年海南省初中学业水平考试地理卷试题真题(含答案).pdf VIP
文档评论(0)