摘要
对于AI与数据库优化问题,现有技术均须改动数据库底层,影响研究成果的应用且缺乏可扩展性.提出一种非嵌入数据库的学习式查询优化方法.在基数估计阶段,使用多模型的方法,对特定的子查询建立神经网络,独立训练不同的子模型,解决需要训练集过多且可扩展性差的问题;在连接优化阶段,应用基于代价的强化学习方法,提高查询优化性能.针对每个查询,从基数估计到连接排序的优化过程都在数据库外执行,按照得到的优化策略对查询重写,并将重写结果返回到数据库中,通过设置参数使该查询按照指定的计划执行.在包含8个表的数据集上进行实验验证,与未进行优化的查询进行比较,非嵌入数据库的优化方法具有良好的优化效果.
For AI and database optimization problems, existing technologies need to change the bottom layer of database, which affects the application of research results and lacks scalability. A learning query optimization method for non-embedded database was proposed. In the cardinality estimation stage, the multi-model method is used to establish a neural network for specific sub queries and train different sub models independently, which solves the problem of too many training sets and poor scalability. In the join optimization stage, cost-based reinforcement learning is applied to improve the query optimization performance. For each query, the optimization processes from cardinality estimation to connection sorting are executed outside the database. The query is rewritten according to the obtained optimization strategy, and the rewriting results are returned to the database. The query is executed according to the specified plan by setting parameters. Experimental verification was carried out on the data set containing eight tables. Compared with the query not optimized, the optimization method of non-embedded database has good optimization effect.
作者
李广龙
申德荣
聂铁铮
寇月
LI Guang-long;SHEN De-rong;NIE Tie-zheng;KOU Yue(School of Computer Science and Engineering,Northeastern University,Shenyang 110169,China)
出处
《浙江大学学报(工学版)》
EI
CAS
CSCD
北大核心
2022年第2期288-296,共9页
Journal of Zhejiang University:Engineering Science
基金
国家自然科学基金资助项目(62172082,62072084,62072086)。
关键词
查询优化
基数估计
连接排序
神经网络
强化学习
query optimization
cardinality estimation
join order
neural network
reinforcement learning