ZeroCard:零依赖目标数据库的基数估计——无数据、无查询、无重训练
ZeroCard: Cardinality Estimation with Zero Dependence on Target Databases -- No Data, No Query, No Retraining
AI总结:
ZeroCard提出首个语义驱动的基数估计方法,利用模式语义预测数据分布,无需原始数据、查询日志或重训练,通过预训练实现即用,显著提升实际部署便利性。
摘要:
基数估计是数据库系统中的一项基本任务,在查询优化中起着关键作用。尽管基于学习的基数估计方法取得了显著进展,但大多数现有方法由于对原始数据或查询的强烈依赖,难以泛化到新的数据集,从而限制了它们在实际场景中的实用性。为了克服这些挑战,我们认为模式中的语义可能有助于基数估计,利用这些语义可能减轻这些依赖。为此,我们引入了ZeroCard,这是第一种语义驱动的基数估计方法,可以在不依赖原始数据访问、查询日志或对目标数据库进行重训练的情况下应用。具体来说,我们提出利用模式语义来预测数据分布,从而避免对原始数据的依赖。然后,我们引入了一种与查询模板无关的表示方法来减轻查询依赖。最后,我们构建了一个源自真实世界表的大规模查询数据集,并在其上预训练ZeroCard,使其能够从模式语义和谓词表示中学习基数。预训练后,ZeroCard的参数可以冻结并以即用方式应用。我们进行了大量实验来展示ZeroCard的独特优势,并展示其在查询优化中的实际应用。其零依赖特性显著促进了在实际场景中的部署。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。