Open Access
- 12 May 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Management of Data
- Vol. 4 (2) , 1-27
Abstract
We introduce EDB-bounded datalog, a framework for deriving upper bounds on intermediate result sizes and the asymptotic complexity of recursive queries in datalog. We present an algorithm that, given an arbitrary datalog program, constructs an EDB-bounded datalog program in which every rule is adorned with a (non-recursive) conjunctive query that subsumes the result of the rule, thus acting as an upper bound. From such adornments, we define a notion of width based on (integral or fractional) edge-cover widths. Through the adornments and the width measure, we obtain, for every IDB predicate, worst-case upper bounds on their sizes, which are polynomial in the input data size, given a fixed program structure. Furthermore, with these size bounds, we also derive fixed-parameter tractable, output-sensitive asymptotic complexity bounds for evaluating the entire program. Additionally, by adapting our framework, we obtain a semi-decision procedure for datalog boundedness that efficiently rewrites most practical bounded programs into non-recursive equivalent programs.Keywords
All Related Versions
Funding Information
- Ministry of Education - Singapore (Tier 1 grant (RS32\/25))
- Nanyang Technological University (Start-up Grant)
- Vienna Science and Technology Fund (10.47379\/ICT2201, 10.47379\/VRG18013, 10.47379\/NXT22018)
This publication has 36 references indexed in Scilit:
- Datalog-Based Language-Agnostic Change Impact Analysis for Microservices2025
- Recursive Queries: Twenty-Five Years After SQL:19992024
- Adaptive Recursive Query Optimization2024
- Size Bounds and Query Plans for Relational JoinsSIAM Journal on Computing, 2013
- XSB: Extending Prolog with Tabled Logic ProgrammingTheory and Practice of Logic Programming, 2011
- Dynamic programming strikes back2008
- The DLV system for knowledge representation and reasoningACM Transactions on Computational Logic, 2006
- Hypertree Decompositions and Tractable QueriesJournal of Computer and System Sciences, 2002
- On the Expected Size of Recursive Datalog QueriesJournal of Computer and System Sciences, 1995
- The Complexity of Counting Cuts and of Computing the Probability that a Graph is ConnectedSIAM Journal on Computing, 1983