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).
Highlights
Query evaluation is a fundamental task in databases, and a vast amount of literature is devoted to the complexity of this problem
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 first-order logic (FO)+MOD recently obtained by Heimberg, Kuske, and Schweikardt (LICS 2016)
There is a dynamic algorithm that receives a schema σ, a degree bound d 2, a Boolean FO+MOD[σ]-query φ, and a σ-db D0 of degree d, and computes within tp = f (φ, d) · ||D0|| preprocessing time a data structure that can be updated in time tu = f (φ, d) and allows to return the query result φ(D) with answer time ta = O(1)
Summary
Query evaluation is a fundamental task in databases, and a vast amount of literature is devoted to the complexity of this problem. The problem of deciding whether a given database D satisfies a FO-sentence φ is AW[∗]-complete (parameterised by ||φ||) and it is generally believed that the evaluation problem cannot be solved in time f (||φ||)||D||c for any computable f and constant c (here, ||φ|| and ||D|| denote the size of the query and the database, respectively) For this reason, a long line of research focused on increasing classes of sparse instances ranging from databases of bounded degree [19] (where every domain element occurs only in a constant number of tuples in the database) to classes that are nowhere dense [9]. Boolean first-order queries can be evaluated on classes of databases of bounded degree in linear time f (||φ||)||D||, where the constant factor f (||φ||) is 3-fold exponential in ||φ|| [19, 7]. Due to space constraints some technical proofs are deferred to the full version of the paper [3]
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.