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...
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Recommended Reading
Abiteboul S, Hull R, Vianu V. Foundations of databases. Reading: Addison-Wesley; 1995.
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.
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.
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.
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.
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.
Green TJ. Containment of conjunctive queries on annotated relations. In: Proceedings of the 12th International Conference on Database Theory; 2009.
Grumbach S, Libkin L, Milo T, Wong L. Query languages for bags: expressive power and complexity. SIGACT News; 1996, p. 27.
Ioannidis YE, Ramakrishnan R. Containment of conjunctive queries: beyond relations as sets. ACM Trans Database Syst. 1995;20(3):288–324.
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.
Klausner A, Goodman N. Multirelations – semantics and languages. In Proceedings of the 11th International Conference on Very Large Data Bases; 1985.
Klug AC. Equivalence of relational algebra and relational calculus query languages having aggregate functions. J ACM. 1982;29(3):699–717.
Lovász L. Operations with structures. Acta Math Hungarica. 1967;18(3–4):321–8.
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.
Mumick IS, Shmueli O. Finiteness properties of database queries. In: Proceedings of the 4th Australian Database Conference 1993.
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.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Section Editor information
Rights and permissions
Copyright information
© 2018 Springer Science+Business Media, LLC, part of Springer Nature
About this entry
Cite this entry
Green, T.J. (2018). Bag Semantics. In: Liu, L., Özsu, M.T. (eds) Encyclopedia of Database Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-8265-9_979
Download citation
DOI: https://doi.org/10.1007/978-1-4614-8265-9_979
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4614-8266-6
Online ISBN: 978-1-4614-8265-9
eBook Packages: Computer ScienceReference Module Computer Science and Engineering