用量子机器学习提升数据库查询基数估算准确率
QCardEst/QCardCorr: Quantum Cardinality Estimation and Correction
- 设计量子-经典混合网络,用量子态编码查询语句
- 在JOB-light数据集上使优化器性能提升6.37倍
- 适合对数据库查询优化有极致要求的研究者
基数估算在数据库管理系统(DBMS)的查询优化中至关重要。我们提出一种基于量子机器学习的量子基数估算(QCardEst)方法,采用量子-经典混合网络。通过紧凑编码将SQL查询转化为量子态,仅需与查询中表数量相等的量子比特,即可在现有硬件上用单个变分量子电路(VQC)处理完整查询。我们比较了多种经典后处理层,将VQC输出的概率向量转换为基数估计值。此外,我们提出量子基数修正方法(QCardCorr),通过VQC生成修正因子,乘以经典估算结果以提升精度。使用QCardCorr后,在JOB-light数据集上,相比标准PostgreSQL优化器性能提升6.37倍,在STATS数据集上提升8.66倍;在JOB-light上甚至优于MSCN,提升3.47倍。
原文摘要 · Abstract (English)
Cardinality estimation is an important part of query optimization in DBMS. We develop a Quantum Cardinality Estimation (QCardEst) approach using Quantum Machine Learning with a Hybrid Quantum-Classical Network. We define a compact encoding for turning SQL queries into a quantum state, which requires only qubits equal to the number of tables in the query. This allows the processing of a complete query with a single variational quantum circuit (VQC) on current hardware. In addition, we compare multiple classical post-processing layers to turn the probability vector output of VQC into a cardinality value. We introduce Quantum Cardinality Correction QCardCorr, which improves classical cardinality estimators by multiplying the output with a factor generated by a VQC to improve the cardinality estimation. With QCardCorr, we have an improvement over the standard PostgreSQL optimizer of 6.37 times for JOB-light and 8.66 times for STATS. For JOB-light we even outperform MSCN by a factor of 3.47.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。