资源描述:
《管理信息系统中的DB2数据库查询优化研究》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、分类号学号M200775070学校代码10487密级硕士学位论文管理信息系统中的DB2数据库查询优化研究学位申请人:于晨昕学科专业:软件工程指导教师:沈刚教授答辩日期:2009.5.22AThesisSubmittedinPartialFulfillmentoftheRequirementsfortheDegreefortheMasterofEngineeringResearchofDB2DatabaseQueryOptimizationforManagementInformationSystemsCandida
2、te:YuChenxinMajor:SoftwareEngineeringSupervisor:Prof.ShenGangHuazhongUniversityofScienceandTechnologyWuhan430074,P.R.ChinaMay,2009摘要信息系统离不开数据的管理,离不开数据库。信息系统与数据库的交互消耗,逐渐成为信息系统的瓶颈。所以,将数据库性能优化的理论应用于信息系统,将会大大提高信息系统的访问速度,促进信息系统的快速发展。多年以来,商业数据库生产商一直致力于提高数据库的查询性能。DB
3、2处理查询语句,主要有五个步骤:解析查询语句、语义检查、重写查询语句、查询优化、生成执行代码。数据库查询优化即数据库管理系统根据分析树生生很多访问路径,根据统计信息估算执行每条访问路径消耗成本,最终选出最佳的执行路径。优化器选择最佳访问路径,主要根据目录统计信息计算过滤因子,计算出CPU消耗以及I/O消耗,最终得到一个访问路径的总消耗。因此,统计信息在数据库优化中具有重大的作用。索引能够帮助数据库管理系统快速定位数据,减少I/O的消耗,合理的设计索引,在数据库优化时也会起到不可或缺的作用。在开发信息系统时,优化数
4、据库需要在以下几方面进行:合理设计数据库、合理写查询语句、提供适当的统计信息、合理设计索引等。此外,还应将应用系统中对数据库的循环存取改进为一次存取,外部循环。将数据库查询优化的理论应用到信息系统中,会使DB2准确判断查询语句的访问路径,信息系统的访问速度提高,有助于信息系统的进一步发展。关键词:数据库优化查询优化DB2数据库管理信息系统IAbstractInformationsystemassociateswithdatamanagement,andassociateswithdatabase.Informat
5、ionsystemintegratewithdatabase,hasbecomethebottleneckofinformationsystemsbynow.Therefore,applythetheoryofdatabaseoptimizationtoinformationsystem,willgreatlyimprovesaccessingdatabase,andpromotestherapiddevelopmentofinformationsystems.Overtheyears,theproduction
6、sofcommercialdatabaseshavebeenimprovingtheperformanceofqueries.TherearefivestepsinDB2queryprocessing:parsing,semanticprocessing,querytransformation,queryoptimization,andcodegeneration.Theoptimizergeneratesmanyequivalentexecutionplansforsatisfyingthequery,andt
7、henestimatetheexecutioncost,theoptimizerchoosesthefastestplanbasedontheestimatedcosts.Whenoptimizerchoosingthebestaccesspath,itcalculatesthefilterfactorbasedonstatistics,andthencalculatestheCPUcostandI/Ocost,sogetatotalcost.Statisticsplaysagrateroleforoptimiz
8、er.ProperindexcanhelpDBMSfetchthedataquickly;reducethecostofI/O,sotheproperindexalsoplayagreatroleforoptimizer.Inthedevelopmentofinformationsystem,wemustfollowthefollowings:createproperda