Efficient enumeration for conjunctive queries over x-underbar structures

  • Authors:
  • Guillaume Bagan;Arnaud Durand;Emmanuel Filiot;Olivier Gauwin

  • Affiliations:
  • INRIA Lille, Mostrare;ELM, CNRS FRE, Université Paris Diderot;Université Libre de Bruxelles;Université de Mons

  • Venue:
  • CSL'10/EACSL'10 Proceedings of the 24th international conference/19th annual conference on Computer science logic
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

We investigate efficient enumeration algorithms for conjunctive queries for databases over binary relations that satisfy the X property. Treelike 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 delay 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 l of variables that appear in inequalities. We propose efficient enumeration procedures for acyclic and general conjunctive queries whose delay is exponential in l but polynomial (even quasi-linear) in |Q| and |S|.