Equivalences Among Relational Expressions with the Union and Difference Operators

Yehoshua Sagiv, Mihalis Yannakakis*

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

245 Scopus citations

Abstract

Queries in relational databases can be formulated in terms of relational expressions using the relational operations select, project, join, union, and difference The equivalence problem for these queries is studied with query optimization m mind It ts shown that testmg eqmvalence of relational expressions with the operators select, project, join, and union is complete m the class FIt of the polynomial-time hierarchy A nonprocedural representation for queries formulated by these expressions is proposed This method of query representation can be viewed as a generahzatlon of tableaux or conjunctive queries (which are used to represent expressions with only select, project, and join) Furthermore, this method is extended to queries formulated by relatmnal expressions that also contain the difference operator, provided that the project operator is not applied to subexpresstons with the difference operator A procedure for testing eqmvalence of these queries is given It ts shown that testmg containment of tableaux is a necessary step in testing equivalence of queries with union and difference Three important cases m which containment of tableaux can be tested m polynomial time are described, although the containment problem is shown to be NP-complete even for tableaux that correspond to expressions with only one project and several join operators.

Original languageEnglish
Pages (from-to)633-655
Number of pages23
JournalJournal of the ACM
Volume27
Issue number4
DOIs
StatePublished - 1 Oct 1980
Externally publishedYes

Keywords

  • conjunctive query
  • equivalence of queries
  • H 2P-complete
  • NP-complete
  • polynomial-time hierarchy
  • query optimization
  • relational algebra
  • relatmnal database
  • tableau

Fingerprint

Dive into the research topics of 'Equivalences Among Relational Expressions with the Union and Difference Operators'. Together they form a unique fingerprint.

Cite this