kc第12讲-数据索引技术.ppt

  1. 1、本文档共37页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
kc第12讲-数据索引技术,岛风go技术支持kcv4.1,空间数据库索引技术,数据库索引技术,ni数据采集技术十讲,数据库技术讲课视频,数据库索引,数据库索引原理,数据库索引的作用,数据库索引设计与优化

Basic Concepts Example of B+-Tree -样式 Non-Leaf Nodes in B+-Trees(非叶节点) Non leaf nodes form a multi-level sparse index on the leaf nodes. For a non-leaf node with m pointers: m?n All the search-keys in the subtree to which P1 points are less than K1 For 2 ? i ? n – 1, all the search-keys in the subtree to which Pi points have values greater than or equal to Ki–1 and less than Ki All the search-keys in the subtree to which Pn points have values greater than or equal to Kn–1 *Queries on B+-Trees(查询) 注:参5版教材-大同小异 Find all records with a search-key value of k. N=root Repeat Examine N for the smallest search-key value k. If such a value exists, assume it is Ki. Then set N = Pi Otherwise k ? Kn–1. Set N = Pn Until N is a leaf node If for some i, key Ki = k follow pointer Pi to the desired record or bucket. Else no record with search-key value k exists. Queries on B+-Trees (节点大小效率) If there are K search-key values in the file, the height of the tree is no more than ?log?n/2?(K)?. K-记录数 A node is generally the same size as a disk block, typically 4 kilobytes (4k) and n is typically around 100 (40 bytes per index entry). n-节点大小 With 1 million search key values and n = 100 at most log50(1,000,000) = 4 nodes are accessed in a lookup. Contrast this with a balanced binary tree with 1 million search key values — around 20 nodes are accessed in a lookup above difference is significant since every node access may need a disk I/O, costing around 20 milliseconds 毫秒 Updates on B+-Trees:Insertion(插入更新算法) Find the leaf node in which the search-key value would appear 索引项已存在时: If the search-key value is already present in the leaf node Add record to the main file修改主文件 If necessary add a pointer to the bucket.必要时(当索引项不是主码时,这时叶节点不是直接指向文件记录,而是间接指向指针桶,如象p.323图12.9)修改相应指针桶 索引项不存在时:If the search-key value is not present, then add the record to the main file (and create a bucket if necessary) 节点未满时:

文档评论(0)

xiaolan118 + 关注
实名认证
内容提供者

你好,我好,大家好!

版权声明书
用户编号:7140162041000002

1亿VIP精品文档

相关文档