External Sorting - Universit#233; dOttawa - University of Ottawa外部排序-大学和# 233;dottawa -渥太华大学.pptVIP
- 1、本文档共18页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ExternalSorting-Universitamp;#233;dOttawa-UniversityofOttawa外部排序-大学和#233;dottawa-渥太华大学.ppt
Selected Topics: External Sorting, Join Algorithms, … Chapters 13—15: 13.1—13.5, 14.4, … Why Sort? A classic problem in computer science (See Knuth, v.3)! Data requested in sorted order e.g., find students in increasing gpa order Sorting is first step in bulk loading B+ tree index. Sorting useful for eliminating duplicate copies in a collection of records (Why?) Sort-merge join algorithm involves sorting. Problem: sort 1Gb of data with 1Mb of RAM. why not virtual memory? 2-Way Merge Sort: Requires 3 Buffers Pass 1: Read a page, sort it (in memory), write it. only one buffer page is used Pass 2, 3, …, etc.: three buffer pages used. 2-Way Merge Sort: Algorithm proc two-way_extsort(file) // Given a file on disk, sort it using 3 buffer pages //Pass 0: produce 1runs Read each page of file into memory, sort it, and write it out. //Merge pairs of runs to produce longer runs until 1 run is left While # of runs at end of previous pass 1 do: //Process passes i=1,2,… While there are runs to be merged from previous pass do: Pick next 2 runs from previous pass. Reach read each run into an input buffer, 1 page at a time. Merge the runs and write result to the output buffer by forcing output buffer to disk one page at a time. endproc Two-Way External Merge Sort Each pass we read + write each page in file = 2N I/O’s per pass. N pages in the file = the number of passes So total cost is: Idea: Divide and conquer: sort subfiles and merge Input file contains 7 pages; dark pages shows what would happen with 8 pages. General External Merge Sort To sort a file with N pages using B buffer pages: Pass 0: use B buffer pages. Produce sorted runs of B pages each. Pass 2, …, etc.: merge B-1 runs. General External Merge Sort: Algorithm proc extsort(file) // Given a file on disk, sort it using B buffer pages //Pass 0: produce Bs runs Read B pages of file into memory, sort them, and write them out. //Merge B-1 runs to produce longer r
您可能关注的文档
- 专题二求准确—怎样获取和解读信息、调动和运用知识讲义.ppt
- 2011届高三化学二轮三轮总复习 重点突破考前第6天掌握物质的特征及重要转化关系课件.ppt
- 新课标人教版小学语文《月球之谜》课件.ppt
- ASCE Manual 73 Quality in the Constructed ProjectASCE手册73质量在建项目.ppt
- 幼儿英语故事《饥饿的毛毛虫》[突破英语等级考试].ppt
- 喜蜂鸟淘车网汽车项目A轮融资商业策划书.pptx
- NIH Initiatives in Diabetes, Obesity and MetabolismNIH的举措,糖尿病,肥胖和代谢.ppt
- 2012届江苏苏教版学海导航高中新课标总复习(第1轮)理数(课件):第11章第62讲 空间向量的概念及运算.ppt
- NET Framework Advanced TopicsNET框架的高级主题.ppt
- 3-管理信息系统的技术基础.ppt
- 2024火电电力职业鉴定能力提升B卷题库【全国通用】附答案详解.docx
- 2024火电电力职业鉴定考试黑钻押题附答案详解【突破训练】.docx
- 2024火电电力职业鉴定考试黑钻押题新版附答案详解.docx
- 2024火电电力职业鉴定考试黑钻押题带答案详解(研优卷).docx
- 2024火电电力职业鉴定考试黑钻押题附答案详解【巩固】.docx
- 2024火电电力职业鉴定考试黑钻押题附完整答案详解【全优】.docx
- 2024火电电力职业鉴定考试黑钻押题及完整答案详解(夺冠).docx
- 2025年01月山东威海环翠区属事业单位医疗岗招聘报考条件笔试历年专业考点(难、易错点荟萃)附带答案详解.docx
- 2024火电电力职业鉴定考试黑钻押题及完整答案详解(名师系列).docx
- 2024火电电力职业鉴定考试黑钻押题及答案详解(易错题).docx
最近下载
- 高中数学第四章定积分4.3定积分的简单应用4.3.2简单几何体的体积教案.docx VIP
- TZSQX008-2020建设工程全过程质量行为导则.docx VIP
- 2024年山东省高中学业水平合格考生物试卷试题(含答案详解).docx VIP
- 高级教师职称评审答辩简答题.doc VIP
- 禁毒情报学习通超星期末考试答案章节答案2024年.docx VIP
- 北京市2024年艺术类专业考生综合分分数分布(一分一段表).pdf VIP
- 2025年乳腺癌诊疗指南(doc14页) .pdf VIP
- 篮球的起源与发展ppt课件.pptx VIP
- 网上调查赚钱经验及技巧总结.doc VIP
- ALPHA AS100说明书-V102用户手册.pdf
文档评论(0)