Evaluating Datalog over Semirings: A Grounding-based Approach
Open Access
- 10 May 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Management of Data
- Vol. 2 (2) , 1-26
Abstract
Datalog is a powerful yet elegant language that allows expressing recursive computation. Although Datalog evaluation has been extensively studied in the literature, so far, only loose upper bounds are known on how fast a Datalog program can be evaluated. In this work, we ask the following question: given a Datalog program over a naturally-ordered semiring σ, what is the tightest possible runtime? To this end, our main contribution is a general two-phase framework for analyzing the data complexity of Datalog over σ: first ground the program into an equivalent system of polynomial equations (i.e. grounding) and then find the least fixpoint of the grounding over σ. We present algorithms that use structure-aware query evaluation techniques to obtain the smallest possible groundings. Next, efficient algorithms for fixpoint evaluation are introduced over two classes of semirings: (1) finite-rank semirings and (2) absorptive semirings of total order. Combining both phases, we obtain state-of-the-art and new algorithmic results. Finally, we complement our results with a matching fine-grained lower bound.Keywords
All Related Versions
Funding Information
- NSF (IIS-2008107,IIS-2147061,IIS-1910014)
This publication has 42 references indexed in Scilit:
- Efficiently enumerating minimal triangulationsDiscrete Applied Mathematics, 2021
- It’s All a Matter of DegreeTheory of Computing Systems, 2017
- Lower Bounds for Tropical Circuits and Dynamic ProgramsTheory of Computing Systems, 2014
- Querying graph databases2013
- Annotated XML2008
- Provenance semirings2007
- Program analysis via graph reachabilityInformation and Software Technology, 1998
- The parallel complexity of simple logic programsJournal of the ACM, 1993
- Parallel complexity of logical query programsAlgorithmica, 1988
- A generalization of Dijkstra's algorithmInformation Processing Letters, 1977