The complexity of evaluating relational queries

https://doi.org/10.1016/S0019-9958(83)80059-XGet rights and content
Under an Elsevier user license
open archive

A sequence of results which characterize exactly the complexity of problems related to the evaluation of relational queries consisting of projections and natural joins is proved. It is shown that testing whether the result of a given query on a given relation equals some other given relation is Dp-complete (Dp is the class of languages that are equal to the intersection of a language in NP and a language in co-NP—it includes both NP and co-NP, and was recently introduced in a totally different context, see Papadimitriou and Yannakakis, 1982, Proceedings, 14th Annual ACM Sympos. on the Theory of Computing, San Francisco, Calif., pp. 255–260). It is shown that testing inclusion or equivalence of queries with respect to a fixed relation (or of relations with respect to a fixed query) is Πp2-complete. The complexity of estimating the number of tuples of the answer is also examined.

Cited by (0)