基于索引的分层采样用于在线聚合
Index-Assisted Stratified Sampling for Online Aggregation
AI总结:
本文提出基于索引的分层采样方法,通过两阶段框架优化采样成本,提升在线聚合效率,在极端情况下相比传统方法实现3倍至98708倍的加速。
摘要:
在扁平模式中,针对频繁更新的数据进行即席查询是实时数据分析应用中的常见需求,通常需要极低的延迟。在线聚合可通过提供带有置信界保证的近似聚合答案来实现。它依赖于能够在线线性时间内抽取样本的能力,而不是数据库大小,这可以通过基于索引的采样近似查询处理(S-AQP)系统支持。然而,这些系统中的近似查询延迟仍可能受到实现所需置信界所要求的过度采样成本的影响,特别是对于具有高方差值分布和选择性的数据。经典分层抽样方法通过奈曼分配可以理论上最小化样本量,但有几个挑战阻止其在基于索引的S-AQP系统中应用,包括需要先验统计、高优化成本以及基于样本量的不准确采样成本模型。为此,我们设计了基于索引的分层抽样用于在线聚合,其特征是两阶段采样框架。第一阶段抽取的样本用于在线聚合和优化未来的采样成本,而第二阶段继续使用优化的分层进行在线聚合。我们证明了基于索引的采样成本模型的最优分层和样本量分配策略,并设计了几种贪心和动态规划基于的优化方法,以在优化成本和效果之间取得平衡。我们在多个真实世界和合成数据集和查询上评估了我们的方法,结果表明我们的方法在极端情况下相比基于索引的均匀采样和经典扫描分层采样分别实现了3倍至98708倍的加速。
英文摘要:
Ad-hoc queries over frequently updated data in a flat schema are common in real-time data analysis applications and often require very low latency. Online aggregation can achieve so by providing approximate aggregation answers with confidence bound guarantees. It relies on the ability to draw samples online in a linear time to sample size rather than database size, which can be supported by index-assisted Sampling-based Approximate Query Processing (S-AQP) systems. However, the query latencies of approximate queries in these systems can still suffer from excessive sampling cost required to achieve a desired confidence bound, due to increased sample size for data with high variance in value distribution and selectivity. Classic stratified sampling methods with Neyman allocation can minimize sample size in theory, but several challenges prevent it from being applicable in index-assisted S-AQP systems, including requiring apriori statistics, high optimization cost, and inaccurate sampling cost model based on sample size. Towards that, we design index-assisted stratified sampling for online aggregation, which features a two-phase sampling framework. Samples drawn from first phase are used for both online aggregation and optimizing future sampling cost, while the second phase continues the online aggregation using the optimized strata. We prove optimal stratification and sample size allocation strategies for index-based sampling cost model, and design several greedy and dynamic programming based optimization methods to balance optimization cost and effectiveness in cost reduction. We evaluate our methods on several real-world and synthetic datasets and queries, and the results show ours consistently achieve good speedup and, in extreme cases, up to 3x speedup and 98708x speedup, when compared to index-assisted uniform sampling and classic scan-based stratified sampling respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。