Abstract
We investigate the query evaluation problem for fixed queries over fully dynamic databases, where tuples can be inserted or deleted. The task is to design a dynamic algorithm that immediately reports the new result of a fixed query after every database update.
We consider queries in first-order logic (FO) and its extension with modulo-counting quantifiers (FO+MOD) and show that they can be efficiently evaluated under updates, provided that the dynamic database does not exceed a certain degree bound.
In particular, we construct a data structure that allows us to answer a Boolean FO+MOD query and to compute the size of the result of a non-Boolean query within constant time after every database update. Furthermore, after every database update, we can update the data structure in constant time such that afterwards we are able to test within constant time for a given tuple whether or not it belongs to the query result, to enumerate all tuples in the new query result, and to enumerate the difference between the old and the new query result with constant delay between the output tuples. The preprocessing time needed to build the data structure is linear in the size of the database.
Our results extend earlier work on the evaluation of first-order queries on static databases of bounded degree and rely on an effective Hanf normal form for FO+MOD recently obtained by Heimberg, Kuske, and Schweikardt (LICS 2016).
- Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of Databases. Addison-Wesley. Google ScholarDigital Library
- Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2017. Answering conjunctive queries under updates. In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, (PODS’17), Emanuel Sallinger, Jan Van den Bussche, and Floris Geerts (Eds.). ACM, 303--318. Google ScholarDigital Library
- Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2017. Answering FO+MOD queries under updates on bounded degree databases. In Proceedings of the 20th International Conference on Database Theory, ICDT 2017, March 21-24, 2017, Venice, Italy (LIPIcs), Michael Benedikt and Giorgio Orsi (Eds.), Vol. 68. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 8:1--8:18.Google Scholar
- Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2018. Answering UCQs under Updates and in the presence of integrity constraints. In Proceedings of the 21st International Conference on Database Theory (ICDT’18). 8:1--8:19.Google Scholar
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms (3rd ed.). MIT Press. Google ScholarDigital Library
- Arnaud Durand and Etienne Grandjean. 2007. First-order queries on structures of bounded degree are computable with constant delay. ACM Trans. Comput. Log. 8, 4 (2007). Google ScholarDigital Library
- Arnaud Durand, Nicole Schweikardt, and Luc Segoufin. 2014. Enumerating answers to first-order queries over databases of low degree. In Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS’14). 121--131. Google ScholarDigital Library
- Markus Frick and Martin Grohe. 2004. The complexity of first-order and monadic second-order logic revisited. Ann. Pure Appl. Logic 130, 1--3 (2004), 3--31.Google ScholarCross Ref
- Martin Grohe. 2017. Descriptive Complexity, Canonisation, and Definable Graph Structure Theory. Lecture Notes in Logic, Vol. 47. Association for Symbolic Logic in conjunction with Cambridge University Press.Google Scholar
- Martin Grohe, Stephan Kreutzer, and Sebastian Siebertz. 2017. Deciding first-order properties of nowhere dense graphs. J. ACM 64, 3 (2017), 17:1--17:32. Conference version: in Proceedings of the 46th ACM Symposium on Theory of Computing (STOC’14), pp. 89--98, 2014. Google ScholarDigital Library
- Martin Grohe and Nicole Schweikardt. 2018. First-order query evaluation with cardinality conditions. In Proceedings of the 37th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS’18). Google ScholarDigital Library
- Lucas Heimberg, Dietrich Kuske, and Nicole Schweikardt. 2016. Hanf normal form for first-order logic with unary counting quantifiers. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS’16). 277--286. Google ScholarDigital Library
- Wojciech Kazana and Luc Segoufin. 2011. First-order query evaluation on structures of bounded degree. Logic. Methods Comput. Sci. 7, 2 (2011).Google Scholar
- Wojciech Kazana and Luc Segoufin. 2013. Enumeration of first-order queries on classes of structures with bounded expansion. In Proceedings of the 32nd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS’13). 297--308. Google ScholarDigital Library
- Dietrich Kuske and Nicole Schweikardt. 2017. First-order logic with counting: At least, weak Hanf normal forms always exist and can be computed! In Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS’17). Full version available at CoRR abs/1703.01122.Google Scholar
- Leonid Libkin. 2004. Elements of Finite Model Theory. Springer. Google ScholarDigital Library
- Eugene M. Luks. 1982. Isomorphism of graphs of bounded valence can be tested in polynomial time. J. Comput. Syst. Sci. 25, 1 (1982), 42--65.Google ScholarCross Ref
- Bernard M. E. Moret and Henry D. Shapiro. 1991. Algorithms from P to NP: Volume 1: Design 8 Efficiency. Benjamin-Cummings. Google ScholarDigital Library
- Sushant Patnaik and Neil Immerman. 1997. Dyn-FO: A parallel, dynamic complexity class. J. Comput. Syst. Sci. 55, 2 (1997), 199--209. Google ScholarDigital Library
- Nicole Schweikardt, Luc Segoufin, and Alexandre Vigny. 2018. Enumeration for FO queries over nowhere dense graphs. In Proceedings of the 37th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS’18). Google ScholarDigital Library
- Thomas Schwentick and Thomas Zeume. 2016. Dynamic complexity: Recent updates. SIGLOG News 3, 2 (2016), 30--52. Google ScholarDigital Library
- Detlef Seese. 1996. Linear time computable problems and first-order descriptions. Math. Struct. Comput. Sci. 6, 6 (1996), 505--526.Google ScholarCross Ref
- Luc Segoufin and Alexandre Vigny. 2017. Constant delay enumeration for FO queries over databases with local bounded expansion. In Proceedings of the 20th International Conference on Database Theory (ICDT’17). 20:1--20:16.Google Scholar
Index Terms
- Answering FO+MOD Queries under Updates on Bounded Degree Databases
Recommendations
Answering Conjunctive Queries under Updates
PODS '17: Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database SystemsWe consider the task of enumerating and counting answers to k-ary conjunctive queries against relational databases that may be updated by inserting or deleting tuples. We exhibit a new notion of q-hierarchical conjunctive queries and show that these can ...
Comments