arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.05536cs.DB
收藏

连接-聚合查询的输出最优算法

Output-Optimal Algorithms for Join-Aggregate Queries

Xiao Hu

AI总结:

本文首次用自由连接分数超树宽度刻画无环连接-聚合查询的输出最优复杂度,证明半环算法的匹配上下界,实现了40年来对Yannakakis算法的首次多项式改进。

摘要:

在交换半环上定义的连接-聚合查询计算中,最著名的成果之一是1981年提出的经典Yannakakis算法。已知对于任何自由连接(free-connex)查询,Yannakakis算法的运行时间为$O(N + \OUT)$,其中$N$是数据库的输入规模,$\OUT$是查询结果的输出规模。这已经是输出最优的。然而,对于剩余的大量无环但非自由连接查询,已知的运行时间上界仅为$O(N \cdot \OUT)$。另一种方法是利用树分解技术将非自由连接查询转换为自由连接查询,然后运行Yannakakis算法。这种方法需要$O\left(N^{\\#\fnsubw} + \OUT\right)$时间,其中$\\#\fnsubw$是输入查询的自由连接子模宽度。但是,这些结果中没有一个是已知输出最优的。本文证明了通过半环算法计算一般无环连接-聚合查询的匹配下界和上界$Θ\left(N \cdot \OUT^{1- \frac{1}{\fnfhtw}} + \OUT\right)$,其中$\fnfhtw$是查询的自由连接分数超树宽度。例如,自由连接查询的$\fnfhtw=1$,线查询(又称链式矩阵乘法)的$\fnfhtw=2$,具有$k$个关系的星型查询(又称星型矩阵乘法)的$\fnfhtw=k$。虽然这一度量此前已被定义,但我们是首次使用它来刻画无环连接-聚合查询的输出最优复杂度。据我们所知,这是过去40年来对Yannakakis算法的首次多项式改进,并完全解决了计算无环连接-聚合查询的输出最优算法这一悬而未决的问题。

英文摘要:

One of the most celebrated results of computing join-aggregate queries defined over commutative semi-rings is the classic Yannakakis algorithm proposed in 1981. It is known that the runtime of the Yannakakis algorithm is $O(N + \OUT)$ for any free-connex query, where $N$ is the input size of the database and $\OUT$ is the output size of the query result. This is already output-optimal. However, only an upper bound $O(N \cdot \OUT)$ on the runtime is known for the large remaining class of acyclic but non-free-connex queries. Alternatively, one can convert a non-free-connex query into a free-connex one using tree decomposition techniques and then run the Yannakakis algorithm. This approach takes $O\left(N^{\#\fnsubw} + \OUT\right)$ time, where $\#\fnsubw$ is the {\em free-connex sub-modular width} of the input query. But, none of these results is known to be output-optimal. In this paper, we show a matching lower and upper bound $Θ\left(N \cdot \OUT^{1- \frac{1}{\fnfhtw}} + \OUT\right)$ for computing general acyclic join-aggregate queries by {\em semiring algorithms, where $\fnfhtw$ is the free-connex fractional hypertree width} of the query. For example, $\fnfhtw=1$ for free-connex queries, $\fnfhtw =2$ for line queries (a.k.a. chain matrix multiplication), and $\fnfhtw=k$ for star queries (a.k.a. star matrix multiplication) with $k$ relations. While this measure has been defined before, we are the first to use it to characterize the output-optimal complexity of acyclic join-aggregate queries. To our knowledge, this has been the first polynomial improvement over the Yannakakis algorithm in the last 40 years and completely resolves the open question of an output-optimal algorithm for computing acyclic join-aggregate queries.

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

↑