arXiv:2506.16007cs.DBcs.LG2025-06被引 3

无需数据访问,也能在不完整查询中准确估算结果规模。

Data-Agnostic Cardinality Learning from Imperfect Workloads

  • 基于查询工作负载构建模型,不依赖原始数据或统计信息。
  • 在仅使用10%连接模板下,准确率超越传统方法。
  • 适合数据受限、连接模式不完整的真实数据库场景。

基数估计(CardEst)是查询优化的关键。传统方法依赖直接基于数据的统计信息,但组织政策常限制数据访问。查询驱动的卡基数估计可利用查询工作负载学习模型,但现有方法通常需数据或摘要支持,并假设训练工作负载具有完整且均衡的连接模板(或连接图),这在真实场景中很少成立。我们提出GRASP,一种面向不完美工作负载的数据无关基数学习系统。其组合式设计能泛化至未见连接模板,对模板不平衡具有鲁棒性;引入新的每表卡基数模型以应对范围谓词下的值分布变化,并提出一种新型学习型计数草图模型,捕捉基表间的连接相关性。在三个数据库实例上,GRASP在不完美工作负载下始终优于现有查询驱动模型,兼具更高的估计精度与更低的查询延迟。尤为突出的是,在复杂且完整的CEB-IMDb-full基准上,尽管未访问任何数据且仅使用10%可能的连接模板,其性能仍可媲美甚至超越基于底层数据的传统方法。

原文摘要 · Abstract (English)

Cardinality estimation (CardEst) is a critical aspect of query optimization. Traditionally, it leverages statistics built directly over the data. However, organizational policies (e.g., regulatory compliance) may restrict global data access. Fortunately, query-driven cardinality estimation can learn CardEst models using query workloads. However, existing query-driven models often require access to data or summaries for best performance, and they assume perfect training workloads with complete and balanced join templates (or join graphs). Such assumptions rarely hold in real-world scenarios, in which join templates are incomplete and imbalanced. We present GRASP, a data-agnostic cardinality learning system designed to work under these real-world constraints. GRASP's compositional design generalizes to unseen join templates and is robust to join template imbalance. It also introduces a new per-table CardEst model that handles value distribution shifts for range predicates, and a novel learned count sketch model that captures join correlations across base relations. Across three database instances, we demonstrate that GRASP consistently outperforms existing query-driven models on imperfect workloads, both in terms of estimation accuracy and query latency. Remarkably, GRASP achieves performance comparable to, or even surpassing, traditional approaches built over the underlying data on the complex CEB-IMDb-full benchmark -- despite operating without any data access and using only 10% of all possible join templates.

基数估计查询优化数据隐私无数据学习

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