文摘
Most existing studies on the expressive power of query languages have focused on what queries can be expressed and what queries cannot be expressed in a query language. They do not tell us much about whether a query can be implemented efficiently in a query language. Yet, paradoxically, efficiency is a key concern in computer science. In this paper, the efficiency of queries in $\mathcal{NRC}(powerset)$ , a nested relational calculus with a powerset operation, is discussed. A dichotomy in the efficiency of these queries on a large general class of structures—which include long chains, deep trees, etc.—is proved. In particular, it is shown that these queries are either already expressible in the usual nested relational calculus or require at least exponential space. This Dichotomy Theorem, when coupled with the bounded degree and locality properties of the usual nested relational calculus becomes a powerful general tool in studying the intensional expressive power of query languages. The bounded degree and locality properties make it easy to prove that a query is inexpressible in the usual nested relational calculus. Then, if the query is expressible in $\mathcal{NRC}(powerset)$ , subject to the conditions of the Dichotomy Theorem, the query must take at least exponential space.