Computer Engineering and Applications ›› 2022, Vol. 58 ›› Issue (2): 86-94.DOI: 10.3778/j.issn.1002-8331.2012-0419

• Theory, Research and Development • Previous Articles     Next Articles

Selecting Execution Plan for Concurrent Queries Using LSTM-FCN

ZHANG Binhui, SONG Chunhua, NIU Baoning, LIU Haonan, TAO Wenxia, CHENG Yongqiang   

  1. College of Information and Computer Science, Taiyuan University of Technology, Jinzhong, Shanxi 030600, China
  • Online:2022-01-15 Published:2022-01-18

基于LSTM-FCN的并发查询执行计划选择

章彬慧,宋春花,牛保宁,柳浩楠,陶温霞,程永强   

  1. 太原理工大学 信息与计算机学院,山西 晋中 030600

Abstract: Query is the main load of the database system. Choosing an appropriate execution plan for query is the key to improve the performance of the database, and eventually that of the application system. Aiming at the problem of the relatively low accuracy and insufficient dynamics in the execution plan selected by the query optimizers for the concurrent query, this paper proposes a concurrent query execution plan selection method based on LSTM-FCN using the time domain characteristics of LSTM(long short-term memory) network, and the advantages of FCN(full connected networks) for feature fusion and classification. It designs and codes the execution plan and interaction characteristics for the query mix, then feeds them into the network, thereby selecting an appropriate execution plan for the query in actual operating scenarios dynamically. Experiments on PostgreSQL verify that the method proposed in this article is feasible and effective. LSTM-FCN selects the appropriate execution plan based on the average accuracy of 97.06% for the query under the conditions of different query mixes and parallelism of 3, 4, 5, 6, and 7.

Key words: concurrent queries, deep learning, long short-term memory-full connected networks(LSTM-FCN), query interaction, appropriate query plan

摘要: 查询是数据库系统的主要负载,为查询选择合适的执行计划是提高数据库系统性能、最终提升应用系统性能的关键。针对当前查询优化器为并发查询选择的执行计划准确率较低、动态性不足的问题,利用长短期记忆(long short-term memory,LSTM)网络的时域特性和全连接层网络(full connected networks,FCN)对特征的融合及分类优势,提出基于LSTM-FCN的并发查询执行计划选择方法。设计并编码查询组合的执行计划特征和交互特征,将其作为网络的输入,为查询动态选择适合实际运行场景的执行计划。在PostgreSQL上的实验验证了所提方法可行有效,LSTM-FCN在不同查询组合及并行度为3、4、5、6、7的情况下,以97.06%的平均准确率为查询选择合适的执行计划。

关键词: 并发查询, 深度学习, 长短期记忆-全连接层网络(LSTM-FCN), 查询交互, 合适的执行计划