QuickSel:基于混合模型的快速选择性学习
QuickSel: Quick Selectivity Learning with Mixture Models
摘要:
估计查询的选择性是几乎所有基于成本的查询优化器中的关键步骤。当今的大多数数据库都依赖于直方图或样本,这些直方图或样本在底层数据发生变化时通过重新扫描数据来定期刷新。由于频繁扫描的成本很高,这些统计信息通常是过时的,导致选择性估计不佳。作为扫描的替代方案,已经提出了查询驱动直方图,其基于观察到的查询的实际选择性来细化直方图。不幸的是,这些方法要么成本太高,无法在实践中使用,即,需要指数级数量的存储桶-或者在观察更多查询时迅速失去优势。在本文中,我们提出了一个选择性学习框架,称为QuickSel,它属于查询驱动的范式,但不使用直方图。相反,它构建了底层数据的内部模型,可以更快地细化(例如,对于300个查询仅1.9毫秒)。这种快速细化允许QuickSel不断从每个查询中学习,并随着时间的推移产生越来越准确的选择性估计。与查询驱动的直方图不同,QuickSel依赖于混合模型和新的优化算法来训练其模型。我们在两个真实世界数据集上进行的广泛实验证实,在相同的目标精度下,QuickSel比最先进的查询驱动直方图(包括ISOMER和STHOLE)快34.0 - 179.4倍。此外,在相同的空间预算下,QuickSel的准确度分别比连续更新的直方图和样本高26.8%-91.8%。
英文摘要:
Estimating the selectivity of a query is a key step in almost any cost-based query optimizer. Most of today's databases rely on histograms or samples that are periodically refreshed by re-scanning the data as the underlying data changes. Since frequent scans are costly, these statistics are often stale and lead to poor selectivity estimates. As an alternative to scans, query-driven histograms have been proposed, which refine the histograms based on the actual selectivities of the observed queries. Unfortunately, these approaches are either too costly to use in practice---i.e., require an exponential number of buckets---or quickly lose their advantage as they observe more queries. In this paper, we propose a selectivity learning framework, called QuickSel, which falls into the query-driven paradigm but does not use histograms. Instead, it builds an internal model of the underlying data, which can be refined significantly faster (e.g., only 1.9 milliseconds for 300 queries). This fast refinement allows QuickSel to continuously learn from each query and yield increasingly more accurate selectivity estimates over time. Unlike query-driven histograms, QuickSel relies on a mixture model and a new optimization algorithm for training its model. Our extensive experiments on two real-world datasets confirm that, given the same target accuracy, QuickSel is 34.0x-179.4x faster than state-of-the-art query-driven histograms, including ISOMER and STHoles. Further, given the same space budget, QuickSel is 26.8%-91.8% more accurate than periodically-updated histograms and samples, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。