lecture-07-bags-versus-sets

lecture-07-bags-versus-sets - Bags Versus Sets Extended...

This preview shows pages 1–9. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Bags Versus Sets Extended Operators Joins Extended Operators in SQL and Relational Algebra T. M. Murali September 15, 2010 T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bags or Sets? I So far, we have said that relational algebra and SQL operate on relations that are sets of tuples. I Real RDBMSs treat relations as bags of tuples. I A tuple can appear multiple times in a relation. T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bags or Sets? I So far, we have said that relational algebra and SQL operate on relations that are sets of tuples. I Real RDBMSs treat relations as bags of tuples. I A tuple can appear multiple times in a relation. I Performance is one of the main reasons; T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bags or Sets? I So far, we have said that relational algebra and SQL operate on relations that are sets of tuples. I Real RDBMSs treat relations as bags of tuples. I A tuple can appear multiple times in a relation. I Performance is one of the main reasons; duplicate elimination is expensive since it requires sorting. I If we use bag semantics, we may have to redefine the meaning of each relation algebra operator. T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bag Semantics: Projection and Selection I Projection ( π ()): process each tuple independently; a tuple may appear in the resulting relation multiple times. I Selection ( σ ()): process each tuple independently; a tuple may appear in the resulting relation multiple times. T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bag Semantics: Projection and Selection I Projection ( π ()): process each tuple independently; a tuple may appear in the resulting relation multiple times. I Selection ( σ ()): process each tuple independently; a tuple may appear in the resulting relation multiple times. R A B C 1 2 3 1 2 4 2 3 4 2 3 4 T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bag Semantics: Projection and Selection I Projection ( π ()): process each tuple independently; a tuple may appear in the resulting relation multiple times. I Selection ( σ ()): process each tuple independently; a tuple may appear in the resulting relation multiple times. R A B C 1 2 3 1 2 4 2 3 4 2 3 4 π A , B (R) T. M. Murali September 15, 2010 Extended Operators in SQL and Relational Algebra Bags Versus Sets Extended Operators Joins Bag Semantics: Projection and Selection I Projection ( π ()): process each tuple independently; a tuple may appear in the resulting relation multiple times....
View Full Document

{[ snackBarMessage ]}

Page1 / 60

lecture-07-bags-versus-sets - Bags Versus Sets Extended...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online