- 1、本文档共38页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Les08-排序关联
Sorting and Joining Objectives After completing this lesson, you should be able to do the following: Optimize sort performance Describe different join techniques Explain join optimization Find optimal join execution plans Sort Operations SORT UNIQUE SORT AGGREGATE SORT GROUP BY SORT JOIN SORT ORDER BY Tuning Sort Performance Sorting large sets can be expensive, so you should tune sort parameters. Note that DISTINCT, GROequijoind most set operators cause implicit sorts. Minimize sorting by one of the following: Try to avoid DISTINCT and GROUP BY. Use UNION ALL instead of UNION. Enable index access to avoid sorting. Top-N SQL Join Terminology Join statement Join predicate, nonjoin predicate Single-row predicate Join Terminology Natural join Join with nonequal predicate Join Operations A join operation combines the output from two row sources and returns one resulting row source. Join operation types include the following: Nested loops join Sort/merge join Hash join Cluster join Nested Loops Joins One of the two tables is defined as the outer table (or the driving table). The other table is called the inner table. For each row in the outer table, all matching rows in the inner table are retrieved. Nested Loops Join Plan When Are Nested Loop Joins Used? Nested loop joins are used when: Joining a few rows that have a good driving condition Order of tables is important USE_NL(table1 table2)hint is used Hash Joins A hash join is executed as follows: Both tables are split into as many partitions as required, using a full table scan. For each partition pair, a hash table is built in memory on the smallest partition. The other partition is used to probe the hash table. Hash Join Plan When Are Hash Joins Used? Hash joins are used if either of the following conditions is true: A large amount of data needs to be joined. A large fraction of the table needs to be joined Use the USE_HASH hint, and use correct values for the following initialization parameters: HASH_AREA_SI
您可能关注的文档
- 2015年北京航空航天大学控制工程专业考研真题汇总、复试真题,考研笔记,复试流程,考研大纲,考研经验.pdf
- 2015年北京航空航天大学控制工程真题汇总、考研大纲,复试真题,考研重点,真题解析,考研心态.pdf
- 2015年北京航空航天大学控制工程真题汇总、复试真题,考试重点,考研真题,考研笔记,考研经验.pdf
- 2015年北京航空航天大学控制工程真题汇总、复试真题,复习方法,考研大纲,考研流程,考研经验.pdf
- 2015年北京航空航天大学控制工程真题汇总、复试真题,考研笔记,复试流程,考研大纲,考研经验.pdf
- HT6507L规格.doc
- 2015年宝山区中西医结合医院爱婴医院试卷 B卷.docx
- ibatis学习文档.doc
- ibatis文档.doc
- 2015年对外经济贸易大学金融硕士考研真题考研分数线考研专业课模拟真题9.pdf
文档评论(0)