arXiv:2510.07983cs.DBcs.AI2025-10

无需数据和查询即可准确估算数据量,打破传统方法依赖瓶颈

ZeroCard: Cardinality Estimation with Zero Dependence on Target Databases -- No Data, No Query, No Retraining

  • 基于模式语义预测数据分布,摆脱对原始数据的依赖
  • 采用查询模板无关表示,不依赖具体查询日志
  • 预训练后直接部署,适合快速落地的数据库优化场景

基数估计是数据库系统中的基础任务,对查询优化至关重要。尽管学习型方法取得进展,但多数仍严重依赖原始数据或查询日志,难以泛化到新数据集。本文提出ZeroCard,首个完全基于模式语义的基数估计方法,无需目标数据库的原始数据、查询日志或重新训练。通过利用模式语义预测数据分布,避免对原始数据的依赖;设计查询模板无关表示,降低对查询的依赖;并构建大规模真实表衍生的查询数据集进行预训练,使模型从模式语义和谓词表示中学习基数规律。预训练完成后参数冻结,可即插即用。实验验证其显著优势,并在查询优化中展示实际应用价值,零依赖特性极大促进真实场景部署。

原文摘要 · Abstract (English)

Cardinality estimation is a fundamental task in database systems and plays a critical role in query optimization. Despite significant advances in learning-based cardinality estimation methods, most existing approaches remain difficult to generalize to new datasets due to their strong dependence on raw data or queries, thus limiting their practicality in real scenarios. To overcome these challenges, we argue that semantics in the schema may benefit cardinality estimation, and leveraging such semantics may alleviate these dependencies. To this end, we introduce ZeroCard, the first semantics-driven cardinality estimation method that can be applied without any dependence on raw data access, query logs, or retraining on the target database. Specifically, we propose to predict data distributions using schema semantics, thereby avoiding raw data dependence. Then, we introduce a query template-agnostic representation method to alleviate query dependence. Finally, we construct a large-scale query dataset derived from real-world tables and pretrain ZeroCard on it, enabling it to learn cardinality from schema semantics and predicate representations. After pretraining, ZeroCard's parameters can be frozen and applied in an off-the-shelf manner. We conduct extensive experiments to demonstrate the distinct advantages of ZeroCard and show its practical applications in query optimization. Its zero-dependence property significantly facilitates deployment in real-world scenarios.

基数估计数据库零依赖

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。