资源描述:
《何婧《数据系统库设计》实验6》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、云南大学软件学院实验报告姓名:张和才学号:20121120265班级:2012级软件工程FI期:成绩:—实验六数据库优化一实验任务1.B+treeindex(1)ConstructaB+-treeforthefollowingsetofkeyvalues:(2,3,5,7,11,17,19,23,29,31)Assumethatthetreeisinitiallyemptyandvaluesareaddedinascendingorder.ConstructB+-treesforthecaseswherethenumberofpoint
2、ersthatwillfitinonenodeis4.(2)ForthisB+-treeofPractice(1),showtheformofthetreeaftereachofthefollowingseriesofoperations:a.Insert9.b.Insert10.cInserts.d.Delete23.e.Delete19.(3)ForthisB+-treeofPractice(1),showthestepsinvolvedinthefollowingqueries:a.Findrecordswithasearch-k
3、eyvalueof11.b.Findrecordswithasearch-keyvaluebetween7and17,inclusive.2.QugryProcessingLetrelationsrl(A:B,C)andr2(C?D?E)havethefollowingproperties:rlhas20,000tuples.r2has45.000tuples.25tuplesofrlfitononeblockand30tuplesofr2fitononeblock.Estimatethenumberofblocktransfersan
4、dseeksrequired,usingeachofthefollowingjoinstrategiesforrl
5、X1r2:(1)Nested-loopjoin(2)Mergejoin3.QugryOptimizationSupposethataB+-treeindexon(deptname,building)isavailableonrelationdepartment.Whatwouldbethebestwaytohandlethefollowingselection?O{buildingfa帖边grf55000)a{depiy2
6、ame=fIns计)(血卩如〃1少住)实验环境Windows7^wps.wwwvws三实验结果记录1.B+treeindex(1)ConstructaB^-treefor±efollowingsetofkeyvalues:(2,3,5,7,11?17,19,23,29,31)c.Insert8.(1)ForthisB^-rreeofPractice(1),showthestepsinvolvedinthefollowingqueries:a.Fmdrecordswithasearch-ke%*valueofILStepl->2找根节^7
7、.31,11>7Step2•渣找节点31的子节点17,23311K17Step3->«找子节点17的子节,511,17,11-11b.Findrecordswithasearch-keyvaluebetween7and17,inclusive.Stepl•渣找根节点7,31,7■磴找到叶子节点7Step2-渣找节点31自节点17,2331,17=17$找到叶子节点17S"p3-進興矽叶子节点7・172.QuwryProcessing(1)Nested-loopjoinUsingrlastheouterrelationweneed2000
8、0•1500*800-30,000,800diskaccesses,ifr2istheouterrelationweneed45000・800*1500-36,001,500diskaccesses.(2)MergejoinAssumingthatrlandr2arenotinitiallysortedon±ejoinkey?thetotalsortingcostinclusiveoftheoutputisBs^lSOO•([21ogM-1(1500Nf)]*2H800•([21ogM-1(800Nf)]*2)diskaccessesA
9、ssumingalltupleswithth亡samevalueforthejoinattributesfitmmemorythetotalcostis1500*800diskaccesses3.Querj