JIT编译技术在可插拔存储引擎数据库中的应用
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家重点研发计划(2023YFC3603103); 浙江省“尖兵领雁+X”研发攻关计划(2024C01019)


Applications of JIT Compilation Technology in Databases with Pluggable Storage Engines
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    数据库系统作为数据存储与处理的基础设施, 其性能对现代社会的运行效率具有重要影响. 随着内存技术的进步及SSD (solid state drive)的广泛应用, 磁盘数据库的性能瓶颈逐渐转向CPU的利用率和内存管理的优化. 现代数据库系统通常采用解释执行的方式处理查询, 造成了大量虚函数调用、上下文切换和高速缓存未命中, 不能充分发挥现代CPU的流水线和缓存机制, 导致低效的查询执行效率, 尤其是在大数据量和复杂查询的场景中表现更为明显. 为了解决上述问题, 针对传统数据库解释执行提供若干JIT (just-in-time)编译优化方案, 并在MySQL数据库中进行验证. 首先给出利用LLVM (low level virtual machine)编译器将SQL谓词在运行时转换为机器码的方案代替解释执行, 以减少虚函数调用和系统上下文切换的开销. 接着提出混合编译与解释执行的方案, 扩展了JIT编译执行的适用范围. 最后针对日益流行的可插拔数据库系统架构设计了一种将JIT机器码推送至存储引擎层的查询下推方案, 避免不必要的数据传输和计算开销. 实验结果表明, 启用JIT编译后, MySQL的查询性能显著提升, 尤其在处理复杂查询和大数据量的场景, JIT编译系统能够有效降低解释执行带来的开销, 显著提高系统的响应速度和吞吐量. 在类TPC-H的测试中, 对比原生MySQL, 采用JIT编译执行的系统性能提升可达148%.

    Abstract:

    Database systems serve as the foundational infrastructure for data storage and processing, with their performance playing a critical role in the efficiency of modern society. With the advancement of memory technologies and the widespread adoption of SSDs (solid state drives), the performance bottleneck in disk-based databases has shifted towards optimizing CPU utilization and memory management. However, current database query execution often relies on interpreted methods, leading to numerous virtual function calls, context switches, and cache misses. This limits the ability of modern CPUs to fully utilize their pipelines and cache mechanisms, resulting in inefficient query execution, particularly in scenarios involving large datasets and complex queries. To address these issues, this study proposes several just-in-time (JIT) compilation optimization strategies for traditional interpreted database execution, validated through experiments on MySQL. First, an approach is presented wherein the LLVM (low level virtual machine) compiler is used to convert SQL predicates into machine code at runtime, replacing the interpretation method to reduce the overhead of virtual function calls and context switching. Next, a hybrid compilation and interpretation approach is introduced to extend the applicability of JIT execution. Finally, a query pushdown strategy is designed for pluggable database system architectures, enabling the transfer of JIT-compiled machine code to the storage engine layer to reduce unnecessary data transfer and computational overhead. Experimental results show that enabling JIT compilation significantly enhances MySQL’s query performance. Notably, for complex queries and large datasets, the JIT-compiled system reduces CPU load and memory usage, leading to substantial improvements in system response speed and throughput. In TPC-H-like tests, compared to the native MySQL version, the optimized system shows performance gains of up to 148%.

    参考文献
    相似文献
    引证文献
引用本文

袁巩生,杜晨路,朱阅岸,陈育兴,唐秀,姚畅,陈刚. JIT编译技术在可插拔存储引擎数据库中的应用.软件学报,2026,37(3):1225-1239

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2025-01-09
  • 最后修改日期:2025-03-03
  • 录用日期:
  • 在线发布日期: 2025-12-17
  • 出版日期: 2026-03-06
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号