arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2512.14358cs.AIcs.DB
收藏

TiCard: 可部署的仅解释残差学习用于基数估计

TiCard: Deployable EXPLAIN-only Residual Learning for Cardinality Estimation

PingCAP, Data & AI-Innovation Lab(PingCAP数据与人工智能创新实验室)

Qizhi Wang

AI总结:

TiCard通过仅使用解释信息学习残差修正,提升数据库基数估计的准确性和可部署性。

摘要:

基数估计是基于成本的查询优化的关键瓶颈,但可部署的改进仍然困难:经典估计器遗漏相关性,而学习估计器通常需要工作负载特定的训练流程和侵入性集成。本文提出了TiCard,一个低侵入性、基于修正的框架,它增强(而不是替代)数据库的原生估计器。TiCard通过仅使用EXPLAIN特征学习乘法残差修正,并仅使用EXPLAIN ANALYZE进行离线标签。我们研究了两种实际实现:(i) 一个用于亚毫秒推理的梯度提升回归器,和(ii) 一个适应通过刷新小参考集而无需梯度重新训练的上下文表格基础模型TabPFN。在TiDB上使用TPCH和连接顺序基准,在低跟踪设置(总共263次执行;157次用于学习)中,TiCard显著提高了操作级尾部准确性:P90 Q误差从312.85(原生)降至13.69(TiCard-GBR),P99从37,974.37降至3,416.50(TiCard-TabPFN),而仅连接策略保持近完美的中位数行为。我们将TiCard定位为一个专注于可部署性的AI4DB构建块:明确的范围、保守的集成策略和从离线修正到优化器中的集成路线图。

英文摘要:

Cardinality estimation is a key bottleneck for cost-based query optimization, yet deployable improvements remain difficult: classical estimators miss correlations, while learned estimators often require workload-specific training pipelines and invasive integration into the optimizer. This paper presents TiCard, a low intrusion, correction-based framework that augments (rather than replaces) a database's native estimator. TiCard learns multiplicative residual corrections using EXPLAIN-only features, and uses EXPLAIN ANALYZE only for offline labels. We study two practical instantiations: (i) a Gradient Boosting Regressor for sub-millisecond inference, and (ii) TabPFN, an in-context tabular foundation model that adapts by refreshing a small reference set without gradient retraining. On TiDB with TPCH and the Join Order Benchmark, in a low-trace setting (263 executions total; 157 used for learning), TiCard improves operator-level tail accuracy substantially: P90 Q-error drops from 312.85 (native) to 13.69 (TiCard-GBR), and P99 drops from 37,974.37 to 3,416.50 (TiCard-TabPFN), while a join-only policy preserves near-perfect median behavior. We position TiCard as an AI4DB building block focused on deployability: explicit scope, conservative integration policies, and an integration roadmap from offline correction to in-optimizer use.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑