We present FasCo, a simple yet effective learning-based estimator for the cost of executing a database query plan. FasCo uses significantly shorter training time and a lower inference cost than the state-of-the-art approaches, while achieving higher estimation accuracy. The effectiveness of FasCo comes from embedding abundant explicit execution-plan-based features and incorporating a novel technique called cardinality calibration. Extensive experimental results show that FasCo achieves orders of magnitude higher efficiency than the state-of-the-art methods: on the JOB-M benchmark dataset, it cuts off training plans by 98\%, reducing training time from more than two days to about eight minutes while entailing better accuracy. Furthermore, in dynamic environments, FasCo can maintain satisfactory accuracy even without retraining, narrowing the gap between learning-based estimators and real systems.
Extensive Large-Scale Study of Error in Samping-Based Distinct Value Estimators for Databases
异值估计问题有许多应用。作为数据库查询优化器的一个关键组件,它也具有很高的商业影响。已经提出了许多不同的价值估计,使用各种统计方法。然而,这些估计所产生的错误的特征是一个悬而未决的问题:现有的分析方法是不够强大的,在大规模的广泛的实证研究不存在。我们进行了广泛的大规模的实证研究,从四个不同的方法,11个不同的价值估计的问题,在家庭的Zipfian分布,其参数模型的现实世界中的应用。我们的研究是第一个\emph{scales to the size of a billion-rows},今天的大型商业数据库中进行操作。这使我们能够描述在现实世界中不同值估计应用中遇到的错误。通过挖掘生成的数据,我们表明,估计误差取决于一个关键的潜在参数-平均均匀类大小-以前没有研究过。这个参数还允许我们发现以前未知的错误模式。重要的是,我们是第一个方法,提供了一个框架,\emph{visualizing the error patterns}在不同的价值估计,促进讨论这个问题,在企业设置。我们的误差特征可以用于不同值估计中的几个问题,如混合估计的设计。这项工作的目的是在从业者和研究人员一样,并解决了经常被双方观众问到的问题。