An implementation of dynamic complexity

A dynamic program, as introduced by Dong, Su and Topor and Patnaik and Immerman, maintains the result of a fixed query for an input database which is subject to changes. It can use an auxiliary database whose relations are updated via first-order formulas upon changes of the input database. Important queries like the reachability query can be maintained dynamically, despite the fact that they cannot be expressed in first-order logic in the static setting. However, there is no recent practical evaluation of the performance of dynamic programs based on these results. In this talk I will present preliminary evaluation results on a prototypical implementation in SQL. We study the reachability query for undirected graphs. In addition to insertions and deletions of single edges, we also test the performance for insertions of many edges that are defined by (unions of) conjunctive queries. This talk is based on joint work with Thomas Schwentick, Thomas Zeume and Dennis Ciba. Modern data management systems handle an enormous amount of data, but still have to react quickly to requests. If a query has to be answered frequently, it is often more efficient to materialize the query result instead of recomputing the query from scratch every time the result is requested. However, when the underlying data changes, the stored query result possibly becomes invalid. In that case, instead of evaluating the query from scratch, we update the query result with the help of the old result and possibly further previously computed auxiliary data. This auxiliary data then also needs to be updated whenever the database changes. This dynamic approach of maintaining information under changes was formalized from a descriptive point of view by Patnaik and Immerman [6] and, independently, by Dong, Su and Topor [4]. Within the framework of dynamic (descriptive) complexity, for a relational database subject to changes and a query Q, a dynamic program maintains auxiliary relations including a distinguished relation representing the result of Q. If a change to the database occurs, the auxiliary relations are updated by first-order formulas (or, equivalently, core SQL queries). We call the class of queries that can be maintained in this way DynFO. Recently there has been considerable progress in maintaining important queries. If changes are insertions or deletions of single edges, the reachability query on arbitrary graphs can be maintained in DynFO [1], as well as every MSO-definable query on graphs with bounded treewidth [2]. Furthermore, progress has been obtained in maintaining queries under more complex changes. In the literature, most dynamic programs restrict the admissible changes to insertions and deletions of single tuples, although in practical