arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1909.02629cs.DBcs.DS
收藏

分组随机抽样

Random Sampling for Group-By Queries

Trong Duc Nguyen, Ming-Hung Shih, Sai Sree Parvathaneni, Bojian Xu, Divesh Srivastava, Srikanta Tirthapura

摘要:

随机抽样方法由于其以较小的近似误差为代价,可以显著减少资源占用和响应时间,因此被广泛应用于大型数据库的近似查询处理中。我们考虑随机抽样回答无处不在的类组的查询,第一组数据根据一个或多个属性,然后通过谓词过滤后,在每个组内聚合。分组查询的挑战在于,抽样方法不能专注于优化单个答案的质量(例如所选数据的平均值),但必须同时优化一组答案的质量(每组一个)。我们提出了CVOPT,查询和数据驱动的采样框架的一组查询。为了评估样本的质量,CVOPT基于不同答案的变异系数(CV)的范数(例如$\ell_2$或$\ell_\infty$)定义度量,并构造可证明优化度量的分层样本。CVOPT可以处理数据的分组查询,其中组具有非常不同的统计特征,如频率,均值或方差。CVOPT联合优化多个聚合和多个group-by子句,并提供了一种对特定组或聚合进行优先级排序的方法。当查询工作负载的部分信息已知时,可以对它进行调优,例如在数据仓库中,查询被安排为定期运行。我们的实验结果表明,CVOPT优于当前国家的最先进的样本质量和估计精度的组由查询。在两个真实数据集上的一组查询上,在相同的空间预算下,CVOPT产生的相对误差比竞争方法小5倍。

英文摘要:

Random sampling has been widely used in approximate query processing on large databases, due to its potential to significantly reduce resource usage and response times, at the cost of a small approximation error. We consider random sampling for answering the ubiquitous class of group-by queries, which first group data according to one or more attributes, and then aggregate within each group after filtering through a predicate. The challenge with group-by queries is that a sampling method cannot focus on optimizing the quality of a single answer (e.g. the mean of selected data), but must simultaneously optimize the quality of a set of answers (one per group). We present CVOPT, a query- and data-driven sampling framework for a set of group-by queries. To evaluate the quality of a sample, CVOPT defines a metric based on the norm (e.g. $\ell_2$ or $\ell_\infty$) of the coefficients of variation (CVs) of different answers, and constructs a stratified sample that provably optimizes the metric. CVOPT can handle group-by queries on data where groups have vastly different statistical characteristics, such as frequencies, means, or variances. CVOPT jointly optimizes for multiple aggregations and multiple group-by clauses, and provides a way to prioritize specific groups or aggregates. It can be tuned to cases when partial information about a query workload is known, such as a data warehouse where queries are scheduled to run periodically. Our experimental results show that CVOPT outperforms current state-of-the-art on sample quality and estimation accuracy for group-by queries. On a set of queries on two real-world data sets, CVOPT yields relative errors that are 5x smaller than competing approaches, under the same space budget.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑