Equivalences among Relational Expressions

Many database queries can be formulated in terms of expressions whose operands represent tables of information (relations) and whose operators are the relational operations select, project, and join. This paper studies the equivalence problem for these relational expressions, with expression optimization in mind. A matrix, called a tableau, is proposed as a natural representative for the value of an expression. It is shown how tableaux can be made to reflect functional dependencies among attributes. A polynomial time algorithm is presented for the equivalence of tableaux that correspond to an important subset of expressions, although the equivalence problem is shown to be NP-complete under slightly more general circumstances.

  • [1]  A. V. Aho, C. Beeri and , J. D. Ullman, The theory of joins in relational databases (extended abstract), 18th Annual Symposium on Foundations of Computer Science (Providence, R.I., 1977), IEEE Comput. Sci., Long Beach, Calif., 1977, 107–113 MR0489101 Google Scholar

  • [2]  Alfred V. Aho, John E. Hopcroft and , Jeffrey D. Ullman, The design and analysis of computer algorithms, Addison-Wesley Publishing Co., Reading, Mass.-London-Amsterdam, 1975x+470 MR0413592(54:1706) Google Scholar

  • [3]  A. V. Aho, Ravi Sethi and , J. D. Ullman, R. Rustin, Code optimization and finite Church-Rosser systemsDesign and optimization of compilers (Courant Comput. Sci. Sympos. 5, New York Univ., New York, 1971), Prentice-Hall, Englewood Cliffs, N. J., 1972, 89–105. Prentice-Hall Series in Automat. Comput MR0438758 Google Scholar

  • [4]  W. W. Armstrong, Dependency structures of data base relationshipsInformation processing 74 (Proc. IFIP Congress, Stockholm, 1974), North-Holland, Amsterdam, 1974, 580–583 MR0421121 0296.68038 Google Scholar

  • [5]  P. A. Bernstein, Synthesizing third normal form relations from functional dependencies, ACM Trans. on Database Sys., 1 (1976), 277–298 10.1145/320493.320489 CrossrefGoogle Scholar

  • [6]  P. A. Bernstein and , C. Beeri, An algorithmic approach to normalization of relational database schemes, TR, CSRG-73, Computer Science Research Group, University of Toronto, 1976, Sept. Google Scholar

  • [7]  C. Beeri, R. Fagin and , J. H. Howard, A complete axiomatization for functional and multivalued dependencies, Proc. ACM SIGMOD International Conference on the Management of Data, 1977, 47–61, August Google Scholar

  • [8]  Ashok K. Chandra and , Philip M. Merlin, Optimal implementation of conjunctive queries in relational data bases, Conference Record of the Ninth Annual ACM Symposium on Theory of Computing (Boulder, Colo., 1977), Assoc. Comput. Mach., New York, 1977, 77–90 MR0489103 Google Scholar

  • [9]  E. F. Codd, A relational model for large shared data banks, Comm. ACM, 13 (1970), 377–387 10.1145/362384.362685 0207.18003 CrossrefISIGoogle Scholar

  • [10]  E. F. Codd, R. Rustin, Further normalization of the data base relational modelData Base Systems, Prentice-Hall, Englewood Cliffs, NJ, 1972, 33–64 Google Scholar

  • [11]  E. F. Codd, R. Rustin, Relational completeness of data base sublanguagesData Base Systems, Prentice-Hall, Englewood Cliffs, NJ, 1972, 65–98 Google Scholar

  • [12]  S. A. Cook, The complexity of theorem proving procedures, Proc. 3rd Annual ACM Symposium on Theory of Computing, 1971, 151–158, May 0253.68020 Google Scholar

  • [13]  C. J. Date, An Introduction to Database Systems, Addison-Wesley, Reading, MA, 1977 Google Scholar

  • [14]  C. Delobel, Ph.D. Thesis, Contributions theorétiques à la conception d'un système d'informations, Univ. of Grenoble, 1973, Oct. Google Scholar

  • [15]  R. Fagin, Multivalued dependencies and a new normal form for relational data-bases, ACM Trans. Database Sys., 2 (1977), 262–278 10.1145/320557.320571 CrossrefGoogle Scholar

  • [16]  Michael R. Garey and , David S. Johnson, Computers and intractability, W. H. Freeman and Co., San Francisco, Calif., 1979x+338, A Guide to the Theory of NP-Completeness MR519066 Google Scholar

  • [17]  P. A. V. Hall, Optimization of a single relational expression in a relational data-base system, IBM J. Res. Develop., 20 (1976), 244–257 CrossrefISIGoogle Scholar

  • [18]  Richard M. Karp, R. E. Miller and , J. W. Thatcher, Reducibility among combinatorial problemsComplexity of computer computations (Proc. Sympos., IBM Thomas J. Watson Res. Center, Yorktown Heights, N.Y., 1972), Plenum, New York, 1972, 85–103 MR0378476 CrossrefGoogle Scholar

  • [19]  J. Minker, Performing inferences over relational databases, Proc. ACM SIGMOD International Conference on Management of Data, San Jose, California, 1975, 79–91, May Google Scholar

  • [20]  Frank P. Palermo, J. T. Tou, A data base search problemInformation systems (Fourth Internat. Sympos. Comput. and Information Sci., Miami Beach, Fla., 1972), Plenum Press, New York, 1974, 67–101 MR0468389 CrossrefGoogle Scholar

  • [21]  R. M. Pecherer, Efficient evaluation of expressions in a relational algebra, Proc. ACM Pacific Conf., 1975, 44–49, April Google Scholar

  • [22]  J. Rissanen, Independent components of relations, ACM Trans. Database Sys., 2 (1977), 317–325 10.1145/320576.320580 CrossrefGoogle Scholar

  • [23]  J. M. Smith and , P. Y.-T. Chang, Optimizing the performance of a relational algebra database interface, Comm. ACM, 18 (1975), 568–579 10.1145/361020.361025 CrossrefISIGoogle Scholar

  • [24]  M. Stonebraker and , L. A. Rowe, Observations on data manipulation languages and their embedding in general purpose programming languages, 2 TR UCB/ERL M77-53, University of California, Berkeley, 1977, July Google Scholar

  • [25]  E. Wong and , K. Youssefi, Decomposition—a strategy for query processing, ACM Trans. Database Sys, 1 (1976), 223–241 10.1145/320473.320479 CrossrefGoogle Scholar

  • [26]  C. Zaniolo, Analysis and design of relational schemata for database systems, Tech. Rept., UCLA-ENG-7769, Department of Computer Science, UCLA, 1976, July Google Scholar

  • [27]  M. M. Zloof, Query-by-Example: the invocation and definition of tables and forms, Proc. ACM International Conf. on Very Large Data Bases, 1975, 1–24, Sept. Google Scholar