Skip to main content

Bag Semantics

  • Reference work entry
  • First Online:
  • 46 Accesses

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 via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   4,499.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD   6,499.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Recommended Reading

  1. Abiteboul S, Hull R, Vianu V. Foundations of databases. Reading: Addison-Wesley; 1995.

    MATH  Google Scholar 

  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.

    Article  MathSciNet  MATH  Google Scholar 

  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. 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. 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. 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. Green TJ. Containment of conjunctive queries on annotated relations. In: Proceedings of the 12th International Conference on Database Theory; 2009.

    Google Scholar 

  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. Ioannidis YE, Ramakrishnan R. Containment of conjunctive queries: beyond relations as sets. ACM Trans Database Syst. 1995;20(3):288–324.

    Article  Google Scholar 

  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. Klausner A, Goodman N. Multirelations – semantics and languages. In Proceedings of the 11th International Conference on Very Large Data Bases; 1985.

    Google Scholar 

  12. Klug AC. Equivalence of relational algebra and relational calculus query languages having aggregate functions. J ACM. 1982;29(3):699–717.

    Article  MathSciNet  MATH  Google Scholar 

  13. Lovász L. Operations with structures. Acta Math Hungarica. 1967;18(3–4):321–8.

    Article  MathSciNet  MATH  Google Scholar 

  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. Mumick IS, Shmueli O. Finiteness properties of database queries. In: Proceedings of the 4th Australian Database Conference 1993.

    Google Scholar 

  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 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Todd J. Green .

Editor information

Editors and Affiliations

Section Editor information

Rights and permissions

Reprints and permissions

Copyright information

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

About this entry

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics