arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.05327cs.DBcs.DScs.LO
收藏

通过聚合查询直接获取答案

Direct Access for Answers to Conjunctive Queries with Aggregation

Technion – Israel Institute of Technology(以色列理工学院);Inria, LIRMM, University of Montpellier, CNRS(法国国家信息与自动化研究所,拉格朗日数学与计算实验室,蒙彼利埃大学,法国国家科学研究中心)

Idan Eldar, Nofar Carmeli, Benny Kimelfeld

AI总结:

研究了带有分组和聚合的联接查询的细粒度复杂性,提出在对数线性时间内构造数据结构,实现按字典序快速访问答案,并分析了聚合函数对查询复杂性的影响。

摘要:

我们研究了带有分组和聚合的联接查询的细粒度复杂性。对于常见的聚合函数(如min、max、count、sum),此类查询可以表述为在带有合适可交换半环注释的数据库上的普通联接查询。我们研究如何通过在对数线性时间内构造数据结构,实现按给定字典序快速访问答案。此任务非平凡,因为答案数量可能大于输入大小的对数线性,因此数据结构需要提供答案空间的紧凑表示。在没有聚合和注释的情况下,过去的研究建立了查询和顺序的充分可处理性 条件。对于无自连接的查询,此条件不仅充分,而且必要(在细粒度复杂性中的传统下界假设下)。我们证明,过去的结果在注释数据库中仍然成立,假设注释本身不参与字典序。然而,过去算法不适用于count-distinct聚合,因为该聚合无法高效表示为可交换半环;对于该聚合,我们建立了相应的可处理性 条件。然后我们展示了当包括聚合和注释值在顺序中时问题复杂性的变化。我们还研究了所有关系但一个被注释为乘法单位元(一)的情况,如将聚合查询转换为半环注释时会发生的情况,并研究了具有idempotent加法的半环,如min、max和在对数大小域上的count-distinct的情况。

英文摘要:

We study the fine-grained complexity of conjunctive queries with grouping and aggregation. For common aggregate functions (e.g., min, max, count, sum), such a query can be phrased as an ordinary conjunctive query over a database annotated with a suitable commutative semiring. We investigate the ability to evaluate such queries by constructing in loglinear time a data structure that provides logarithmic-time direct access to the answers ordered by a given lexicographic order. This task is nontrivial since the number of answers might be larger than loglinear in the size of the input, so the data structure needs to provide a compact representation of the space of answers. In the absence of aggregation and annotation, past research established a sufficient tractability condition on queries and orders. For queries without self-joins, this condition is not just sufficient, but also necessary (under conventional lower-bound assumptions in fine-grained complexity). We show that all past results continue to hold for annotated databases, assuming that the annotation itself does not participate in the lexicographic order. Yet, past algorithms do not apply to the count-distinct aggregation, which has no efficient representation as a commutative semiring; for this aggregation, we establish the corresponding tractability condition. We then show how the complexity of the problem changes when we include the aggregate and annotation value in the order. We also study the impact of having all relations but one annotated by the multiplicative identity (one), as happens when we translate aggregate queries into semiring annotations, and having a semiring with an idempotent addition, such as the case of min, max, and count-distinct over a logarithmic-size domain.

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

↑