Analytic function, also called window function, is to query the aggregation of data over a sliding window. For example, a simple query over the online stock platform is to return the average price of a stock of the last three days. These functions are commonly used features in SQL databases. They are supported in most of the commercial databases. With the increasing usage of cloud data infra and machine learning technology, the frequency of queries with analytic window functions rises. Some analytic functions only require const space in memory to store the state, such as SUM, AVG, while others require linear space, such as MIN, MAX. When the window is extremely large, the memory space to store the state may be too large. In this case, we need to spill the state to disk, which is a heavy operation. In this paper, we proposed an algorithm to manipulate the state data in the disk to reduce the disk I/O to make spill available and efficienct. We analyze the complexity of the algorithm with different data distribution.
翻译:分析函数( 也称为窗口函数 ) 是要查询滑动窗口上的数据汇总。 例如, 在线库存平台上的一个简单查询是返回最近三天的库存的平均价格。 这些功能是 SQL 数据库中常用的特性。 这些功能在大多数商业数据库中得到支持。 随着云层数据使用量的增加和机器学习技术, 使用分析窗口函数的查询频率上升。 一些分析函数只需要存储存储状态的记忆中的连接空间, 如 SUM、 AVG 等, 而其它功能则需要线性空间, 如 MIN、 MAX 。 当窗口非常大时, 存储状态的内存空间可能太大 。 在此情况下, 我们需要将状态扩展到磁盘上, 这是一种沉重的操作 。 在本文中, 我们建议使用一种算法来控制磁盘中的状态数据, 以降低磁盘 I/ O 提供溢出和 pericient 。 我们用不同的数据分布分析算法的复杂性 。</s>