Efficient Enumeration for Conjunctive Queries over X-underbar Structures [chapter]

Guillaume Bagan, Arnaud Durand, Emmanuel Filiot, Olivier Gauwin
2010 Lecture Notes in Computer Science  
We investigate efficient enumeration algorithms for conjunctive queries for databases over binary relations that satisfy the X property. Tree-like relations such as XPath axes or grids are natural examples of such relations. We first show that the result of an n-ary conjunctive query Q over an X structure S can be enumerated with a delay in O(n·|S|·|Q|) between two consecutive n-tuples. Then, we consider acyclic conjunctive queries and show that such queries admit an enumeration algorithm with
more » ... elay O(|Q| · |D|) and a preprocessing in O(|Q| · |S|) where D is the domain of S. The delay can even be improved to O(n·|D|) with a slightly more expensive preprocessing step. As an application of our method, we also show that any n-ary XPath acyclic conjunctive query Q over an unranked tree t can be enumerated with a preprocessing and delay O(|Q|·|t|). In the second part of the paper, we consider conjunctive queries with possible inequalities ( =) between variables. In this case, we show that query evaluation is NP-hard and, unless P = NP, these queries do not admit enumeration algorithms with a combined polynomial time delay. However, we also show that hardness relies only on the number ℓ of variables that appear in inequalities. We propose efficient enumeration procedures for acyclic and general conjunctive queries whose delay is exponential in ℓ but polynomial (even quasi-linear) in |Q| and |S|.
doi:10.1007/978-3-642-15205-4_10 fatcat:jpeof6wlezfhjebsbfqoswdbaq