## On the Complexity of Nonrecursive XQuery and Functional Query Languages on Complex Values

### Cached

### Download Links

- [www.cs.cornell.edu]
- [www.cs.cornell.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | In Proc. PODS’05 |

Citations: | 41 - 1 self |

### BibTeX

@INPROCEEDINGS{Koch_onthe,

author = {Christoph Koch},

title = {On the Complexity of Nonrecursive XQuery and Functional Query Languages on Complex Values},

booktitle = {In Proc. PODS’05},

year = {}

}

### Years of Citing Articles

### OpenURL

### Abstract

This article studies the complexity of evaluating functional query languages for complex values such as monad algebra and the recursion-free fragment of XQuery. We show that monad algebra with equality restricted to atomic values is complete for the class TA[2O(n) , O(n)] of problems solvable in linear exponential time with a linear number of alternations. The monotone fragment of monad algebra with atomic value equality but without negation is complete for nondeterministic exponential time. For monad algebra with deep equality, we establish TA[2O(n) , O(n)] lower and exponential-space upper bounds. We also study a fragment of XQuery, Core XQuery, that seems to incorporate all the features of a query language on complex values that are traditionally deemed essential. A close connection between monad algebra on lists and Core XQuery (with “child ” as the only axis) is exhibited, and it is shown that these languages are expressively equivalent up to representation issues. We show that Core XQuery is just as hard as monad algebra w.r.t. query and combined complexity, and that it is in TC0 if the query is assumed fixed. As Core XQuery is NEXPTIME-hard, it is commonly believed that any algorithm for evaluating Core XQuery has to require exponential amounts of working memory and doubly exponential time in the worst case. We present a property of queries – the lack of a certain form of composition – that virtually all real-world XQueries have and that allows for query evaluation in singly exponential time and polynomial space. Still, we are able to show for an important special case – Core XQuery with equality testing restricted to atomic values – that the composition-free language is just as expressive as the language with composition. Thus, under widely-held complexitytheoretic assumptions, the composition-free language is an exponentially less succinct version of the language with composition.

### Citations

1526 |
Foundations of Databases
- Abiteboul, Hull, et al.
- 1995
(Show Context)
Citation Context ...Grumbach and Vianu 1995]). However, the query languages considered by many researchers to be most natural for complex values (such as complex value algebra without powerset [Abiteboul and Beeri 1995; =-=Abiteboul et al. 1995-=-], its syntactic variant monad algebra [Tannen et al. 1992; Buneman et al. 1995], and XQuery) are functional. Monad algebra. Monad algebra is a clean, compositional, variable-free functional query lan... |

530 | The complexity of relational query languages - Vardi - 1982 |

448 |
Optimal implementation of conjunctive queries in relational data bases
- Chandra, Merlin
- 1977
(Show Context)
Citation Context ...uessing, emptiness of the latter. ✷ Proposition 7.7. XQ − [=atomic,child] is NP-hard w.r.t. query complexity. Proof. This follows immediately from the NP-hardness of conjunctive (relational) queries [=-=Chandra and Merlin 1977-=-], and a proof can be given e.g. by reduction from 3-Colorability: The fixed data tree consists of a root node and three children, which are labeled “red”, “green”, and “blue”, respectively. Given a g... |

331 |
A catalog of complexity classes
- Johnson
- 1990
(Show Context)
Citation Context ...uence, it is commonly believed that any query evaluation algorithm for nonrecursive XQuery must consume doubly exponential time and exponential space for query evaluation in the worst case (cf. e.g. [=-=Johnson 1990-=-]). This is by an exponential factor worse than the complexity of relational algebra or calculus [Stockmeyer 1974]. We present a syntactic property – the lack of a certain form of composition – that v... |

279 | Complexity and expressive power of logic programming
- Dantsin, Eiter, et al.
- 2001
(Show Context)
Citation Context ...uages for complex values have almost entirely focused on logic- [Kuper and Vardi 1993a] and particularly logic programmingbased query languages [Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000; =-=Dantsin et al. 2001-=-], and fixpoint languages (e.g. [Grumbach and Vianu 1995]). However, the query languages considered by many researchers to be most natural for complex values (such as complex value algebra without pow... |

198 | Elements of finite model theory - Libkin - 2004 |

142 | Limits to parallel computation: P-completeness theory
- Greenlaw, Hoover, et al.
- 1995
(Show Context)
Citation Context ... that in addition so-called majority-gates are permitted, which compute “true” iff more than half of their inputs are true. For details on circuit complexity and the notion of uniformity we refer to [=-=Greenlaw et al. 1995-=-; Johnson 1990]. We assume deterministic, nondeterministic, and alternating Turing machines known and refer to e.g. [Johnson 1990] for definitions. By DTIME[t(n)] and NTIME[t(n)], we denote the classe... |

132 | Naturally embedded query languages
- Tannen, Buneman, et al.
- 1992
(Show Context)
Citation Context ...theoretical work on query languages for complex values has been carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; Hull and Su 1989; Grumbach and Vianu 1995; =-=Tannen et al. 1992-=-; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong 1997; Vorobyov and V... |

128 | Principles of programming with complex objects and collection types
- Buneman, Naqvi, et al.
- 1995
(Show Context)
Citation Context ...n carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; =-=Buneman et al. 1995-=-; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong 1997; Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000]), and this has laid th... |

120 | On uniformity within NC 1
- Barrington, Immerman, et al.
- 1990
(Show Context)
Citation Context ...lt, that every Core XQuery expression can be encoded as a TC0 reduction that transforms the input data into the query result. By FOM, we denote first-order logic extended with majority quantifiers M [=-=Barrington et al. 1990-=-]. A formula My φ(�x, y) is true if φ(�x, y) is true for more than half of the positions y of the input. It is known that TC0 is equivalent to the class of languages recognizable using FOM sentences [... |

110 |
Remark on the algebra of non first normal form relation
- Jaeschke, Schek
- 1982
(Show Context)
Citation Context ...database applications, such as object-oriented, object-relational, and semistructured data models. A large amount of theoretical work on query languages for complex values has been carried out (e.g. [=-=Jaeschke and Schek 1982-=-; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebran... |

103 |
The Complexity of Decision Problems in Automata Theory and Logic
- Stockmeyer
- 1974
(Show Context)
Citation Context ... exponential time and exponential space for query evaluation in the worst case (cf. e.g. [Johnson 1990]). This is by an exponential factor worse than the complexity of relational algebra or calculus [=-=Stockmeyer 1974-=-]. We present a syntactic property – the lack of a certain form of composition – that virtually all real-world XQueries have and which renders composition-free Core XQuery just as hard as relational a... |

86 | The complexity of xpath query evaluation - Gottlob, Koch, et al. - 2003 |

76 | Projecting XML documents
- Marian, Siméon
- 2003
(Show Context)
Citation Context ...r the language [Hidders et al. 2004; Fernandez et al. 2000; World Wide Web Consortium 2005]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; =-=Marian and Siméon 2003-=-; Florescu et al. 2003; Fernandez and Siméon 2004; Koch et al. 2004]. In this article, we attempt a first closer look at the complexity of XQuery, or more precisely, of the Core XQuery fragment. We at... |

64 | The BEA streaming XQuery processor
- Florescu, Hillery, et al.
(Show Context)
Citation Context ...et al. 2004; Fernandez et al. 2000; World Wide Web Consortium 2005]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; Marian and Siméon 2003; =-=Florescu et al. 2003-=-; Fernandez and Siméon 2004; Koch et al. 2004]. In this article, we attempt a first closer look at the complexity of XQuery, or more precisely, of the Core XQuery fragment. We attempt to do this in a ... |

61 | Towards Tractable Algebras for Bags., in "J
- GRUMBACH, MILO
- 1996
(Show Context)
Citation Context ...query languages for complex values has been carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; =-=Grumbach and Milo 1996-=-; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong 1997; Vorobyov and Voronkov 1998; Dantsin an... |

60 | Query languages for bags and aggregate functions
- Libkin, Wong
- 1997
(Show Context)
Citation Context ...h and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; =-=Libkin and Wong 1997-=-; Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000]), and this has laid the foundations for object-oriented query languages as well as SQL 1999 or XQuery. Earlier complexity studies on query lang... |

56 |
A New Approach to Database Logic
- Kuper, Vardi
- 1984
(Show Context)
Citation Context ...ons, such as object-oriented, object-relational, and semistructured data models. A large amount of theoretical work on query languages for complex values has been done (e.g. [Jaeschke and Schek 1982; =-=Kuper and Vardi 1984-=-; Abiteboul and Beeri Author’s address: Lehrstuhl für Informationssysteme, Universität des Saarlandes, Im Stadtwald, D-66123 Saarbrücken, Germany, koch@infosys.uni-sb.de The results of this article ar... |

54 | Schema-based scheduling of event processors and buffer minimization for queries on structured data streams
- Koch, Scherzinger, et al.
(Show Context)
Citation Context ...b Consortium 2005]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; Marian and Siméon 2003; Florescu et al. 2003; Fernandez and Siméon 2004; =-=Koch et al. 2004-=-]. In this article, we attempt a first closer look at the complexity of XQuery, or more precisely, of the Core XQuery fragment. We attempt to do this in a principled manner, establishing connections t... |

50 |
Problems complete for deterministic logarithmic space
- Cook, McKenzie
- 1987
(Show Context)
Citation Context ...tone fragment. 10 It is folklore that computing the nodes of a tree reachable from a given node via any given axis can be done in LOGSPACE. For the descendant axis, this problem is LOGSPACE-complete [=-=Cook and McKenzie 1987-=-], cf. also [Gottlob et al. 2005].sTheorem 5.6. M∪[=atomic] is NEXPTIME-hard w.r.t. query complexity. Proof. The proof is by a LOGSPACE-reduction from NEXPTIME Turing machine acceptance. There are two... |

48 | The power of languages for the manipulation of complex values
- Abiteboul, Beeri
- 1995
(Show Context)
Citation Context ...object-relational, and semistructured data models. A large amount of theoretical work on query languages for complex values has been carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; =-=Abiteboul and Beeri 1995-=-; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; ... |

46 |
A Relational Model of Data for Large Shared
- Codd
- 1970
(Show Context)
Citation Context ... databases. Indeed, it has been shown that full monad algebra is a conservative extension of relational algebra. By a flat relational database, we denote a relational database in the classical sense [=-=Codd 1970-=-; Abiteboul et al. 1995]. In our data model, a (flat) relational database 5 The “nest” operation of complex value algebra without powerset [Abiteboul and Beeri 1995] groups tuples by some of their att... |

45 |
A decision procedure for the first order theory of real addition with order
- Ferrante, Rackoff
- 1975
(Show Context)
Citation Context ...reduction, we denote a LOGSPACE reduction that produces output of linear size. TA[2 O(n) , O(n)] has important complete problems from logic, such as deciding the Theory of Real Addition [Berman 1980; =-=Ferrante and Rackoff 1975-=-]. There are a number of alternative ways of stating the query evaluation problem. In this article, we study the complexity of Boolean queries. For both monad algebra and XQuery, we think of a nonempt... |

40 | The complexity of XPath query evaluation and XML typing
- Gottlob, Koch, et al.
- 2005
(Show Context)
Citation Context ...at computing the nodes of a tree reachable from a given node via any given axis can be done in LOGSPACE. For the descendant axis, this problem is LOGSPACE-complete [Cook and McKenzie 1987], cf. also [=-=Gottlob et al. 2005-=-].sTheorem 5.6. M∪[=atomic] is NEXPTIME-hard w.r.t. query complexity. Proof. The proof is by a LOGSPACE-reduction from NEXPTIME Turing machine acceptance. There are two main difficulties that we face ... |

39 |
The complexity of logical theories
- Berman
- 1980
(Show Context)
Citation Context ... By a LOGLIN reduction, we denote a LOGSPACE reduction that produces output of linear size. TA[2 O(n) , O(n)] has important complete problems from logic, such as deciding the Theory of Real Addition [=-=Berman 1980-=-; Ferrante and Rackoff 1975]. There are a number of alternative ways of stating the query evaluation problem. In this article, we study the complexity of Boolean queries. For both monad algebra and XQ... |

38 | An algebra for XML query
- Fernández, Siméon, et al.
- 2000
(Show Context)
Citation Context ...set. 1 Little foundational research on XQuery has been done to date. There are only some cautious first attempts at finding clean formalizations of and algebras for the language [Hidders et al. 2004; =-=Fernandez et al. 2000-=-; World Wide Web Consortium 2005]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; Marian and Siméon 2003; Florescu et al. 2003; Fernandez an... |

31 | Typing and querying XML documents: some complexity bounds - Segoufin |

27 | Normal forms and conservative extension properties for query languages over collection types
- Wong
- 1996
(Show Context)
Citation Context ... Beeri 1995; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; =-=Wong 1996-=-; Dantsin and Voronkov 1997; Libkin and Wong 1997; Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000]), and this has laid the foundations for object-oriented query languages as well as SQL 1999 or... |

26 | Tractable query languages for complex object databases
- Grumbach, Vianu
- 1991
(Show Context)
Citation Context ...odels. A large amount of theoretical work on query languages for complex values has been carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; Hull and Su 1989; =-=Grumbach and Vianu 1995-=-; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong ... |

25 | Gucht. Possibilities and limitations of using flat operators in nested algebra expressions - Paredaens, van - 1998 |

23 |
Hierarchies of memory limited computations
- Stearns, Hartmanis, et al.
- 1994
(Show Context)
Citation Context ...al. 1981]). The complexity classes NETIME and 2ETIME are not robust – they are not closed under LOGSPACE-reductions, as can be verified using a simple padding argument and the Time Hierarchy theorem [=-=Hartmanis et al. 1965-=-]. We will consider completeness for those classes as well as of TA[2 O(n) , O(n)] under LOGLINreductions, under which they are known to be closed (cf. e.g. [Dantsin et al. 2001]). By a LOGLIN reducti... |

18 |
Algebraic and Calculus Query Languages for Recursively Typed Complex Objects
- Hull, Su
- 1993
(Show Context)
Citation Context ...lex values has been carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; =-=Hull and Su 1993-=-; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong 1997; Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000]),... |

17 | A light but formal introduction to XQuery
- Hidders, Paredaens, et al.
- 2004
(Show Context)
Citation Context ...algebra without powerset. 1 Little foundational research on XQuery has been done to date. There are only some cautious first attempts at finding clean formalizations of and algebras for the language [=-=Hidders et al. 2004-=-; Fernandez et al. 2000; World Wide Web Consortium 2005]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; Marian and Siméon 2003; Florescu et... |

17 | Complexity of nonrecursive logic programs with complex values
- Vorobyov, Voronkov
- 1998
(Show Context)
Citation Context ...en et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong 1997; =-=Vorobyov and Voronkov 1998-=-; Dantsin and Voronkov 2000]), and this has laid the foundations for object-oriented query languages as well as SQL 1999 or XQuery. Earlier complexity studies on query languages for complex values hav... |

16 | Space Usage in Functional Query Languages
- Abiteboul, Hillebrand
- 1995
(Show Context)
Citation Context ...able I. Query/combined complexity of monad algebra and Core XQuery. 1995; Hull and Su 1989; Grumbach and Vianu 1991; Tannen et al. 1992; Grumbach and Milo 1993; Hull and Su 1993; Buneman et al. 1995; =-=Abiteboul and Hillebrand 1995-=-; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronkov 1997; Libkin and Wong 1997; Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000]), and this has laid the foundations for object-orient... |

16 |
On Accessing Object-oriented Databases: Expressive Power, Complexity, and Restrictions
- Hull, Su
- 1989
(Show Context)
Citation Context ...istructured data models. A large amount of theoretical work on query languages for complex values has been carried out (e.g. [Jaeschke and Schek 1982; Kuper and Vardi 1993b; Abiteboul and Beeri 1995; =-=Hull and Su 1989-=-; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; Dantsin and Voronk... |

15 | Complexity of query answering in logic databases with complex values
- Dantsin, Voronkov
- 1997
(Show Context)
Citation Context ...; Hull and Su 1989; Grumbach and Vianu 1995; Tannen et al. 1992; Grumbach and Milo 1996; Hull and Su 1993; Buneman et al. 1995; Abiteboul and Hillebrand 1995; Paredaens and Van Gucht 1988; Wong 1996; =-=Dantsin and Voronkov 1997-=-; Libkin and Wong 1997; Vorobyov and Voronkov 1998; Dantsin and Voronkov 2000]), and this has laid the foundations for object-oriented query languages as well as SQL 1999 or XQuery. Earlier complexity... |

12 | Expressive power and data complexity of query languages for trees and lists - Dantsin, Voronkov |

6 |
Building an extensible xquery engine: Experiences with Galax (extended abstract
- Fernández, Siméon
- 2004
(Show Context)
Citation Context ... et al. 2000; World Wide Web Consortium 2005]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; Marian and Siméon 2003; Florescu et al. 2003; =-=Fernandez and Siméon 2004-=-; Koch et al. 2004]. In this article, we attempt a first closer look at the complexity of XQuery, or more precisely, of the Core XQuery fragment. We attempt to do this in a principled manner, establis... |

6 | On the role of composition in XQuery - Koch - 2005 |

2 |
XQuery 1.0 and XPath 2.0 Formal Semantics. W3C Working Draft Aug. 16th 2002
- Consortium
- 2002
(Show Context)
Citation Context ... XQuery has been done to date. There are only some cautious first attempts at finding clean formalizations of and algebras for the language [Hidders et al. 2004; Fernandez et al. 2000; World Wide Web =-=Consortium 2005-=-]. Most other recent work has focused on engineering good query processors for XQuery [Ludäscher et al. 2002; Marian and Siméon 2003; Florescu et al. 2003; Fernandez and Siméon 2004; Koch et al. 2004]... |

2 | Web Consortium. 2002. “XQuery 1.0 and XPath 2.0 Formal Semantics. W3C Working Draft - Wide - 2002 |

1 | A Query Language for NC - Engineering, MIT, et al. - 1997 |

1 |
XML Query Use Cases. W3C Working Draft 15
- XQueryUseCases
- 2005
(Show Context)
Citation Context ...ious that queries without recursion are guaranteed to terminate already in straightforward functional implementations of the XQuery language. Recursion in XQuery is rarely used in practice (see also [=-=XQueryUseCases 2005-=-]); recursive XML transformationssare usually implemented in XSLT. In essence, XQuery is a quite natural typed functional programming language for XML; still it is sometimes criticized by the research... |

1 | APPENDIX A.1 Reduction from Monad Algebra to Nonrecursive Logic Programming Proof of Theorem 5.2, Second Version. The proof is by a LOGSPACEreduction to the Success Problem of nonrecursive logic programming with function symbols (but without sets), i.e. t - ELECTRONIC |