欢迎来到天天文库
浏览记录
ID:34826905
大小:277.84 KB
页数:64页
时间:2019-03-11
《浅论mysql查询优化的研究和改进》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、华中科技大学硕士学位论文MySQL查询优化的研究和改进姓名:孙辉申请学位级别:硕士专业:计算机软件与理论指导教师:吴恒山20070606摘要查询是数据库系统中最基本也是最常用的一种操作,因此查询是否具有较快的执行速度,已成为数据库用户和设计者极其关心的问题。在研究开源数据库管理系统MySQL查询优化技术的基础上,主要从MySQL配置参数调优,MySQL查询重用功能,MySQL查询重写的相关规则,MySQL计划优化四个方面展开工作。针对配置参数调优问题,主要从数据缓冲区和日志缓冲区两方面详细介绍了MySQL相关的调优参数。然后研究了MySQL
2、调优的两种方法:人工调优和基于案例的调优,并在此基础上提出了一种动态的自调优算法-爬山法,该方法有效解决了MySQL自身两种调优方法存在的不足。对于查询重用问题,主要针对MySQL重用实现存在的两个问题:重用性不高和不能合理处理大数据集,做出了改进。对于前者,通过增加规范SQL语句关键字和消除多余无效字符的模块来解决。对于后者,通过增加缓存查询执行计划模块来解决,使用缓存查询计划模块来代替MySQL原本的缓存查询结果模块。对于查询重写问题,在研究MySQL现有查询重写技术的基础上,以带IN谓词的子查询为例归纳了其子查询合并的算法,然后提出了
3、两个查询重写规则,NOT操作符重写和外连接转换为一般连接。通过重写,确实提高了MySQL查询的速度。针对计划优化问题,主要研究了MySQL基于规则的优化和基于代价的优化这两种方法。对于前者,详细的介绍了MySQL预定义的一些连接类型及其优先级,对于后者,研究了MySQL在决定表连接顺序时所采用的贪婪算法的具体实现。所有的实验都是采用TPCH标准测试,数据量为10M,实验对改进工作进行了验证,实验结果表明我们的改进工作确实提高了MySQL的查询速度。关键词:查询优化,查询重用,查询重写,计划优化IAbstractQueryisoneofthe
4、basicandcommonlyusingoperationsinDBMS.SowhetherthequeryhasthefastexecutionspeedhasbecomeacoreproblemfortheusersanddesignersofDBMS.Wemainlyfocusonfourmainproblems:MySQLparametersself-tuning,realizationofMySQLqueryreuse,MySQLquerytransformandtheoptimizationofqueryexecutionpl
5、aninthebaseoftheresearchontheopensourceDBMSofMySQL.Fortheproblemofparameterstuning,wefocusonthedatabufferandlogbuffertointroducesometuningparametersofMySQL.AndweintroducetwotuningwaysofMySQL:manualtuningandbasedoncasestuning,Thenwewillproposeanewdynamicself-tuningmethods—m
6、ountainalgorithmanditsolvestheformerfault.Intheproblemofqueryreuse,weaimattwoproblems—poorlyreuseandunabletodealwithbigresultsituationintheMySQLanddosomeimprovements.Fortheformer,weaddtwofunctionstonormalizethekeywordsandremovesomeinvalidandredundantcharactersintheSQLstate
7、ments.Forthelatter,webufferthequeryexecutionplaninsteadofbufferingthequeryresultbyaddingexecutionplanbuffermodule.Fortheproblemofqueryrewrite,wededucethealgorithmofsub-querymerging.Then,weaddtworewriterules—NOToperationrewriteandOuterjointransformstonormaljoin.Bythetransfo
8、rming,thequeryexecutionspeedreallybecomesfast.Fortheproblemofplanoptimization,wemainlyfoc
此文档下载收益归作者所有