Encyclopedia of Database Systems

2018 Edition
| Editors: Ling Liu, M. Tamer Özsu

Bag Semantics

  • Todd J. Green
Reference work entry
DOI: https://doi.org/10.1007/978-1-4614-8265-9_979

Synonyms

Duplicate Semantics; Multiset Semantics

Definition

In the ordinary relational model, relations are sets of tuples, which by definition do not contain “duplicate” entries. However, RDBMSs typically implement a variation of this model where relations are bags (or multisets) of tuples, with duplicates allowed. Formally, a bag is a mapping of tuples to natural number multiplicities; a set can be viewed as a special case of a bag where all tuple multiplicities are 0 or 1. The operations of the relational algebra are extended to operate on bags by defining their action on tuple multiplicities. RDBMSs based on bags rather than sets are said to implement bag semantics (rather than set semantics). Duplicates may occur at multiple levels: in source relations, in materialized views, or in query answers. A variation of bag semantics called bag-set semanticsis obtained by requiring source relations to be sets, while allowing views and query answers to contain duplicates. Bag-set...

This is a preview of subscription content, log in to check access.

Recommended Reading

  1. 1.
    Abiteboul S, Hull R, Vianu V. Foundations of databases. Reading: Addison-Wesley; 1995.zbMATHGoogle Scholar
  2. 2.
    Buneman P, Naqvi S, Tannen V, Wong L. Principles of programming with complex objects and collection types. Theor Comput Sci. 1995;149(1):3–48.MathSciNetzbMATHCrossRefGoogle Scholar
  3. 3.
    Chaudhuri S, Vardi MY. Optimization of real conjunctive queries. In: Proceedings of the 12th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 1993.Google Scholar
  4. 4.
    Cohen S. Equivalence of queries combining set and bag-set semantics. In: Proceedings of the 25th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 2006, p. 70–9.Google Scholar
  5. 5.
    Cohen S, Nutt W, Serebrenik A. Rewriting aggregate queries using views. In: Proceedings of the 18th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 1999.Google Scholar
  6. 6.
    Dayal U, Goodman N, Katz, RH. An extended relational algebra with control over duplicate elimination. In: Proceedings of the 1st ACM SIGACT-SIGMOD Symposium on Principles of Database Systems; 1982, p. 117–23.Google Scholar
  7. 7.
    Green TJ. Containment of conjunctive queries on annotated relations. In: Proceedings of the 12th International Conference on Database Theory; 2009.Google Scholar
  8. 8.
    Grumbach S, Libkin L, Milo T, Wong L. Query languages for bags: expressive power and complexity. SIGACT News; 1996, p. 27.Google Scholar
  9. 9.
    Ioannidis YE, Ramakrishnan R. Containment of conjunctive queries: beyond relations as sets. ACM Trans Database Syst. 1995;20(3):288–324.CrossRefGoogle Scholar
  10. 10.
    Jayram TS, Kolaitis PG, Vee E. The containment problem for real conjunctive queries with inequalities. In: Proceedings of the 25th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 2006.Google Scholar
  11. 11.
    Klausner A, Goodman N. Multirelations – semantics and languages. In Proceedings of the 11th International Conference on Very Large Data Bases; 1985.Google Scholar
  12. 12.
    Klug AC. Equivalence of relational algebra and relational calculus query languages having aggregate functions. J ACM. 1982;29(3):699–717.MathSciNetzbMATHCrossRefGoogle Scholar
  13. 13.
    Lovász L. Operations with structures. Acta Math Hungarica. 1967;18(3–4):321–8.MathSciNetzbMATHCrossRefGoogle Scholar
  14. 14.
    Mumick IS, Pirahesh H, Ramakrishnan R. The magic of duplicates and aggregates. In: Proceedings of the 16th International Conference on Very Large Data Bases; 1990, p. 264–77.Google Scholar
  15. 15.
    Mumick IS, Shmueli O. Finiteness properties of database queries. In: Proceedings of the 4th Australian Database Conference 1993.Google Scholar
  16. 16.
    Nutt W, Sagiv Y, Shurin S. Deciding equivalences among aggregate queries. In: Proceedings of the 17th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 1998, p. 214–23.Google Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.University of PennsylvaniaPhiladelphiaUSA

Section editors and affiliations

  • Val Tannen
    • 1
  1. 1.Dept. of Computer and Inf. ScienceUniv. of PennsylvaniaPhiladelphiaUSA