近距离观察现代数据库系统中的差异实现
A Closer Look at Variance Implementations in Modern Database Systems
摘要:
方差是抽样聚合查询的一个流行且经常是必要的组成部分。它通常用作次要测量,以确定结果的统计特性,例如其误差。然而,它的计算成本比\texttt{SUM}、\texttt{MEAN}和\texttt{COUNT}等简单的主要度量更高。存在许多计算方差的技术。虽然方差的定义被认为需要对数据进行多次传递,但其他数学表示可以在单次传递中计算值。然而,一些单通道表示可能会遭受严重的精度损失,特别是对于大量的数据点。在本文中,我们研究了各种现实世界的系统中的方差实现,并发现主要的数据库系统,如PostgreSQL 9.4和最有可能的系统X,一个主要的商业使用的闭源数据库,使用的表示是有效的,但遭受浮点精度损失造成的灾难性取消。我们注意到另一种流行的表示,如MySQL和Impala,遭受不分布式,因此不能利用现代并行计算资源的数据库中使用的缺陷。我们回顾了过去五十年来统计和数据库社区中方差计算的文献,并总结了在各种设置中实现方差函数的建议,例如近似查询处理和大规模分布式聚合。
英文摘要:
Variance is a popular and often necessary component of sampled aggregation queries. It is typically used as a secondary measure to ascertain statistical properties of the result such as its error. Yet, it is more expensive to compute than simple, primary measures such as \texttt{SUM}, \texttt{MEAN}, and \texttt{COUNT}. There exist numerous techniques to compute variance. While the definition of variance is considered to require multiple passes on the data, other mathematical representations can compute the value in a single pass. Some single-pass representations, however, can suffer from severe precision loss, especially for large number of data points. In this paper, we study variance implementations in various real-world systems and find that major database systems such as PostgreSQL 9.4 and most likely System X, a major commercially used closed-source database, use a representation that is efficient, but suffers from floating point precision loss resulting from catastrophic cancellation. We note deficiencies in another popular representation, used by databases such as MySQL and Impala, that suffers from not being distributive and therefore cannot take advantage of modern parallel computational resources. We review literature over the past five decades on variance calculation in both the statistics and database communities, and summarize recommendations on implementing variance functions in various settings, such as approximate query processing and large-scale distributed aggregation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。