ABSTRACT
We consider the problem of deciding query equivalence for a conjunctive language in which queries output complex objects composed from a mixture of nested, unordered collection types. Using an encoding of nested objects as flat relations, we translate the problem to deciding the equivalence between encodings output by relational conjunctive queries. This encoding equivalence cleanly unifies and generalizes previous results for deciding equivalence of conjunctive queries evaluated under various processing semantics. As part of our characterization of encoding equivalence, we define a normal form for encoding queries and contend that this normal form offers new insight into the fundamental principles governing the behaviour of nested aggregation.
- Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases. Addison-Wesley, 1995. Google Scholar
Digital Library
- Vasilis Aggelis and Stavros Cosmadakis. Optimization of nested SQL queries by tableau equivalence. In Proc. 7th DBPL, volume 1949 of LNCS. Springer, 2000. Google Scholar
Digital Library
- Nicole Bidoit. The verso algebra or how to answer queries with fewer joins. J. Comput. Syst. Sci., 35(3):321--364, 1987. Google Scholar
Digital Library
- Peter Buneman, Shamim A. Naqvi, Val Tannen, and Limsoon Wong. Principles of programming with complex objects and collection types. Theor. Comput. Sci., 149(1):3--48, 1995. Google Scholar
Digital Library
- Ashok K. Chandra and Philip M. Merlin. Optimal implementation of conjunctive queries in relational data bases. In Proc. 9th ACM STOC, pages 77--90, 1977. Google Scholar
Digital Library
- Surajit Chaudhuri and Moshe Y. Vardi. Optimization of real conjuctive queries. In Proc. 12th ACM PODS, pages 59--70, 1993. Google Scholar
Digital Library
- Sara Cohen. Equivalence of queries combining set and bag-set semantics. In Proc. 25th ACM PODS, pages 70--79, 2006. Google Scholar
Digital Library
- Sara Cohen, Werner Nutt, and Yehoshua Sagiv. Deciding equivalences among conjunctive aggregate queries. J. ACM, 54(2):5, 2007. Google Scholar
Digital Library
- Sara Cohen, Yehoshua Sagiv, and Werner Nutt. Equivalences among aggregate queries with negation. ACM Trans. Comput. Logic, 6(2):328--360, 2005. Google Scholar
Digital Library
- Umeshwar Dayal. Of nests and trees: A unified approach to processing queries that contain nested subqueries, aggregates, and quantifiers. In Proc. 13th VLDB, pages 197--208, 1987. Google Scholar
Digital Library
- David DeHaan. Equivalence of nested queries with mixed semantics. Technical Report CS-2009-12, D.R. Cheriton School of Computer Science, University of Waterloo, 2009. Available at http://www.cs.uwaterloo.ca/research/tr/2009/.Google Scholar
Digital Library
- David DeHaan, Per-Ake Larson, and Jingren Zhou. Stacked indexed views in Microsoft SQL Server. In Proc. ACM SIGMOD, pages 179--190, 2005. Google Scholar
Digital Library
- Xin Dong, Alon Y. Halevy, and Igor Tatarinov. Containment of nested XML queries. In Proc. 30th VLDB, pages 132--143, 2004. Google Scholar
Digital Library
- Hector Garcia-Molina, Jeffrey D. Ullman, and Jennifer Widom. Database Systems: The Complete Book. Prentice Hall, 2002. Google Scholar
Digital Library
- Stephane Grumbach, Maurizio Rafanelli, and Leonardo Tininini. Querying aggregate data. In Proc. 18th ACM PODS, pages 174--184, 1999. Google Scholar
Digital Library
- Ashish Gupta, Venky Harinarayan, and Dallan Quass. Aggregate-query processing in data warehousing environments. In Proc. 21st VLDB, pages 358--369, 1995. Google Scholar
Digital Library
- Ashish Gupta, Yehoshua Sagiv, Jeffrey D. Ullman, and Jennifer Widom. Constraint checking with partial information. In Proc. 13th ACM PODS, pages 45--55, 1994. Google Scholar
Digital Library
- Yannis E. Ioannidis and Raghu Ramakrishnan. Containment of conjunctive queries: Beyond relations as sets. ACM Trans. Database Syst., 20(3):288--324, 1995. Google Scholar
Digital Library
- D.S. Johnson and A. Klug. Testing containment of conjunctive queries under functional and inclusion dependencies. J. Comput. Syst. Sci., 28(1):167--189, 1984.Google Scholar
Digital Library
- Won Kim. On optimizing an SQL-like nested query. ACM Trans. Database Syst., 7(3):443--469, 1982. Google Scholar
Digital Library
- Anthony Klug. On conjunctive queries containing inequalities. J. ACM, 35(1):146--160, 1988. Google Scholar
Digital Library
- Alon Y. Levy, Alberto O. Mendelzon, Yehoshua Sagiv, and Divesh Srivastava. Answering queries using views (extended abstract). In Proc. 14th ACM PODS, pages 95--104, 1995. Google Scholar
Digital Library
- Alon Y. Levy and Inderpal Singh Mumick. Reasoning with aggregation constraints. In Proc. 5th EDBT, volume 1057 of LNCS, pages 514--534. Springer, 1996. Google Scholar
Digital Library
- Alon Y. Levy, Inderpal Singh Mumick, and Yehoshua Sagiv. Query optimization by predicate move-around. In Proc. 20th VLDB, pages 96--107, 1994. Google Scholar
Digital Library
- Alon Y. Levy and Dan Suciu. Deciding containment for queries with complex objects (extended abstract). In Proc. 16th ACM PODS, pages 20--31, 1997. Google Scholar
Digital Library
- Leonid Libkin and Limsoon Wong. New techniques for studying set languages, bag languages and aggregate functions. In Proc. 13th ACM PODS, pages 155--166, 1994. Google Scholar
Digital Library
- Hong-Cheu Liu and Jeffery X. Yu. Algebraic equivalences of nested relational operators. Inf. Syst., 30(3):167--204, 2005. Google Scholar
Digital Library
- Sergey Melnik, Atul Adya, and Philip A. Bernstein. Compiling mappings to bridge applications and databases. ACM Trans. Database Syst., 33(4):1--50, 2008. Google Scholar
Digital Library
- Inderpal Singh Mumick, Sheldon J. Finkelstein, Hamid Pirahesh, and Raghu Ramakrishnan. Magic conditions. In Proc. 9th ACM PODS, pages 314--330, 1990 Google Scholar
Digital Library
- G. Ozsoyoglu, Z.M. Ozsoyoglu, and V. Matos. Extending relational algebra and relational calculus with set-valued attributes and aggregate functions. ACM Trans. Database Syst., 12(4):566--592, 1987. Google Scholar
Digital Library
- Shariq Rizvi, Alberto Mendelzon, S. Sudarshan, and Prasan Roy. Extending query rewriting techniques for fine-grained access control. In Proc. ACM SIGMOD, pages 551--562, 2004. Google Scholar
Digital Library
- Kenneth A. Ross, Divesh Srivastava, Peter J. Stuckey, and S. Sudarshan. Foundations of aggregation constraints. Theor. Comput. Sci., 193(1-2):149--179, February 1998. Google Scholar
Digital Library
- Yehoshua Sagiv and Mihalis Yannakakis. Equivalences among relational expressions with the union and difference operators. J. ACM, 27(4):633--655, 1980. Google Scholar
Digital Library
- Marc H. Scholl. Theoretical foundation of algebraic optimization utilizing unnormalized relations. In Proc. ICDT, volume 243 of LNCS, pages 380--396. Springer, 1986. Google Scholar
Digital Library
- Divesh Srivastava, Shaul Dar, H.V. Jagadish, and Alon Y. Levy. Answering queries with aggregation using views. In Proc. 22nd VLDB, pages 318--329, 1996. Google Scholar
Digital Library
- Stan J. Thomas and Patrick C. Fischer. Nested relational structures. In Paris C. Kanellakis, editor, Advances in Computing Research: The Theory of Databases, pages 269--307. JAI Press, 1986.Google Scholar
- Frank Wm. Tompa and Jose A. Blakeley. Maintaining materialized views without accessing base data. Inf. Syst., 13(4):393--406, 1988. Google Scholar
Digital Library
- Jan Van den Bussche, Dirk Van Gucht, and Stijn Vansummeren. Well-definedness and semantic type-checking for the nested relational calculus. Theor. Comput. Sci., 371(3):183--199, March 2007. Google Scholar
Digital Library
- R. van der Meyden. The complexity of querying indefinite data about linearly ordered domains. In Proc. 11th ACM PODS, pages 331--345, 1992. Google Scholar
Digital Library
- Weipeng P. Yan and Per-Ake Larson. Performing group-by before join. In Proc. 10th ICDE, pages 89--100, 1994. Google Scholar
Digital Library
- Markos Zaharioudakis, Roberta Cochrane, George Lapis, Hamid Pirahesh, and Monica Urata. Answering complex SQL queries using automatic summary tables. In Proc. ACM SIGMOD, pages 105--116, 2000. Google Scholar
Digital Library
Index Terms
Equivalence of nested queries with mixed semantics
Recommendations
Equivalence of queries combining set and bag-set semantics
PODS '06: Proceedings of the twenty-fifth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systemsThe query equivalence problem has been studied extensively for set-semantics and, more recently, for bag-set semantics. However, SQL queries often combine set and bag-set semantics. For example, an SQL query that returns a multiset of elements may call ...
Query containment under bag and bag-set semantics
Conjunctive queries (CQs) are at the core of query languages encountered in many logic-based research fields such as AI, or database systems. The majority of existing work assumes set semantics but often in real applications the manipulation of ...
Equivalence of SQL queries in presence of embedded dependencies
PODS '09: Proceedings of the twenty-eighth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systemsWe consider the problem of finding equivalent minimal-size reformulations of SQL queries in presence of embedded dependencies [1]. Our focus is on select-project-join (SPJ) queries with equality comparisons, also known as safe conjunctive (CQ) queries, ...






Comments