Direct Access for Answers to Conjunctive Queries with Aggregation

被引:0
作者
Eldar, Idan [1 ]
Carmeli, Nofar [2 ]
Kimelfeld, Benny [1 ]
机构
[1] Technion Israel Inst Technol, Haifa, Israel
[2] Univ Montpellier, CNRS, LIRMM, INRIA, Montpellier, France
来源
27TH INTERNATIONAL CONFERENCE ON DATABASE THEORY, ICDT 2024 | 2024年 / 290卷
关键词
aggregate queries; conjunctive queries; provenance semirings; commutative semirings; annotated databases; direct access; ranking function; answer orderings; query classification;
D O I
10.4230/LIPIcs.ICDT.2024.4
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We study the fine-grained complexity of conjunctive queries with grouping and aggregation. For some 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. Specifically, we investigate the ability to evaluate such queries by constructing in log-linear 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 log-linear in the size of the input, and so, the data structure needs to provide a compact representation of the space of answers. In the absence of aggregation and annotation, past research provides 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 is not part of the lexicographic order. On the other hand, we show infeasibility for the case of count-distinct that does not have any efficient representation as a commutative semiring. We then investigate the ability to include the aggregate and annotation outcome in the lexicographic order. Among the hardness results, standing out as tractable is the case of a semiring with an idempotent addition, such as those of min and max. Notably, this case captures also count-distinct over a logarithmic-size domain.
引用
收藏
页数:20
相关论文
共 23 条
  • [1] Computing the jth solution of a first-order query
    Bagan, Guillaume
    Durand, Arnaud
    Grandjean, Etienne
    Olive, Frederic
    [J]. RAIRO-THEORETICAL INFORMATICS AND APPLICATIONS, 2008, 42 (01): : 147 - 164
  • [2] Bagan G, 2007, LECT NOTES COMPUT SC, V4646, P208
  • [3] Answering FO plus MOD Queries under Updates on Bounded Degree Databases
    Berkholz, Christoph
    Keppeler, Jens
    Schweikardt, Nicole
    [J]. ACM TRANSACTIONS ON DATABASE SYSTEMS, 2018, 43 (02):
  • [4] Brault-Baron J., 2013, De la pertinence de l'enumeration: complexite en logiques propositionnelle et du premier ordre
  • [5] Tight Fine-Grained Bounds for Direct Access on Join Queries
    Bringmann, Karl
    Carmeli, Nofar
    Mengel, Stefan
    [J]. PROCEEDINGS OF THE 41ST ACM SIGMOD-SIGACT-SIGAI SYMPOSIUM ON PRINCIPLES OF DATABASE SYSTEMS (PODS '22), 2022, : 427 - 436
  • [6] Answering (Unions of) Conjunctive Queries using Random Access and Random-Order Enumeration
    Carmeli, Nofar
    Zeevi, Shai
    Berkholz, Christoph
    Conte, Alessio
    Kimelfeld, Benny
    Schweikardt, Nicole
    [J]. ACM TRANSACTIONS ON DATABASE SYSTEMS, 2022, 47 (03):
  • [7] Tractable Orders for Direct Access to Ranked Answers of Conjunctive Queries
    Carmeli, Nofar
    Tziavelis, Nikolaos
    Gatterbauer, Wolfgang
    Kimelfeld, Benny
    Riedewald, Mirek
    [J]. PODS '21: PROCEEDINGS OF THE 40TH SIGMOD-SIGACT-SIGAI SYMPOSIUM ON PRINCIPLES OF DATABASE SYSTEMS, 2021, : 325 - 341
  • [8] Cohen H., 1993, A course in computational algebraic number theory
  • [9] Deciding equivalences among conjunctive aggregate queries
    Cohen, Sara
    Nutt, Werner
    Sagiv, Yehoshua
    [J]. JOURNAL OF THE ACM, 2007, 54 (02)
  • [10] Eldar I, 2024, Arxiv, DOI [arXiv:2303.05327, DOI 10.48550/ARXIV.2303.05327]