The invention relates to a database query execution plan optimal search method in the search process, including the execution plan are not considered in the Cartesian product containing connection operation plan (unless the query submitted by the user with the Cartesian product operation, as well as the connection link) relationship table statement said in a graph in the figure, finally to search the optimal execution plan; the following is expressed in the form of map connection statement: the figure of the point query relation in a sentence, if the relationship between the two points in a graph of the connection operation (including internal connection and external connection), connects with the two sides. Weight is two connection operation execution cost. As a result of adopting the structure, the optimal execution plan can be obtained in a parallel execution environment.
【技术实现步骤摘要】
本专利技术涉及本专利技术涉及到数据库领域,尤其涉及到数据库在sql语句查询过程中 执行计划在并发执行环境下最优执行方案的搜索方法。
技术介绍
数据库在查询优化过程中,对于一个给定的sql语句,尤其是复杂的sql语句,通 常有许多种可能的策略。一般而言,如果一个查询语句中含有η个关系,有O(n-l)) ! / (n-1) !个不同的连接顺序,当η = 7时,此数为665观0,当n = 10时,此数为176亿。查 询优化就是能从许多的策略中找出代价较小的执行计划的一个处理过程,但是当sql语句 中涉及到的关系数较大(η >6)时,优化引擎如果一一遍历所有的执行计划,将消耗大量的 优化时间,最终导致语句查询效率低下。另外,随着多核服务器的大量出现,为提高语句的 执行效率,并发对语句进行执行成为今后语句执行的趋势,以前查询优化引擎在挑选最优 执行计划时,没有兼顾到语句并发执行的前提,其所提交的最优执行计划无法充分利用多 核的优势。
技术实现思路
本专利技术所要解决的技术问题是提供一种为查询语句从大量的执行计划中快速找 出适合于并发执行的执行计划。为解决上述技术问题,本 ...
【技术保护点】
一种数据库查询中最优执行计划的搜索方法,其特征在于,所述方法包括在执行计划的搜索过程中不予考虑含有笛卡尔积连接操作的执行计划,除非用户提交的查询语句中含有笛卡尔积连接操作,同时将语句中的关系表的连接关系以一个图的形式表示,最后在图中搜索最优执行计划;所述以图的形式表示语句的连接关系如下:图中的点表示查询语句中的关系,如果图中某两个点所对应的关系有连接操作,该连接操作包括内连接和外连接,则连接这两点,边的权值为两关系连接操作的执行代价;所述在图中搜索最优执行计划的方案包含如下一些步骤:步骤一:从图中任一点出发,在图中找出一条以该点为起始点的连接通路,该连接通路对应原查询语句的 ...
【技术特征摘要】
【专利技术属性】
技术研发人员:王非,黄本雄,余国锐,邓磊,
申请(专利权)人:华中科技大学,
类型:发明
国别省市:83
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。