diff --git a/slides/cse4562sp2019/2019-02-04-RA-Basics.html b/slides/cse4562sp2019/2019-02-04-RA-Basics.html index 4a75ba7a..0941d4f0 100644 --- a/slides/cse4562sp2019/2019-02-04-RA-Basics.html +++ b/slides/cse4562sp2019/2019-02-04-RA-Basics.html @@ -219,7 +219,7 @@ For each week:

Relational Algebra

- + $$\pi_{R.A}(\sigma_{S.C=10}(\bowtie_{R.B = S.B}(\textbf{R}, \textbf{S})))$$
@@ -325,7 +325,7 @@ For each week:

Selection ($\sigma_{c}$)

Delete rows that fail the condition $c$.

- $$\sigma_{(BORONAME = \texttt{'Brooklyn'})} \textbf{Trees}$$ + $$\sigma_{(\textbf{BORONAME} = \texttt{'Brooklyn'})} \textbf{Trees}$$ @@ -336,6 +336,11 @@ For each week:
TREE_IDSPC_COMMONBORONAME...
204026'honeylocust''Brooklyn'...
... and 177287 more
+
+

+          SELECT * FROM Trees [[ WHERE BORONAME = 'Brooklyn' ]]
+            
+
@@ -343,7 +348,7 @@ For each week:

Delete attributes not in the projection list $A$.

- $$\pi_{BORONAME}(Trees)$$ + $$\pi_{\textbf{BORONAME}}(Trees)$$ @@ -356,14 +361,19 @@ For each week:

Only 5 results... not 683788?

Set and Bag Projection are different

+
+

+              SELECT [[ DISTINCT BORONAME ]] FROM Trees;
+            
+

Reminder: Queries are Relations

What are these queries schemas?

-
$$\pi_{TREEID, SPC\_COMMON, BORONAME} \textbf{Trees}$$
-
$$\sigma_{(BORONAME = \texttt{'Brooklyn'})} \textbf{Trees}$$
-
$$\sigma_{(BORONAME = \texttt{'Brooklyn'})}(\pi_{TREEID, SPC\_COMMON, BORONAME} \textbf{Trees})$$
+
$$\pi_{\textit{TREEID},\ \textit{SPC_COMMON},\ \textit{BORONAME}} \textbf{Trees}$$
+
$$\sigma_{(\textit{BORONAME} = \texttt{'Brooklyn'})} \textbf{Trees}$$
+
$$\sigma_{(\textit{BORONAME} = \texttt{'Brooklyn'})}(\pi_{\textit{TREEID},\ \textit{SPC_COMMON},\ \textit{BORONAME}} \textbf{Trees})$$
@@ -491,7 +501,7 @@ For each week:

(Which operators behave differently in Set- and Bag-RA?)

BORONAME
Queens
- + @@ -532,47 +542,71 @@ For each week:
-

Division ($/$)

+
+

Division ($/$)

-

Not typically supported as a primitive operator,
but useful for expressing queries like:

-

Find species that appear in all boroughs

-
- $$\pi_{BORONAME,\ SPC\_COMMON}(\textbf{Trees}) \;\;/\;\;\pi_{SPC\_COMMON}(\textbf{Trees})$$ - (using set relational algebra) -
-

- $$R / S \equiv \{\; \left<\vec t\right> \;|\; \forall \left<\vec s\right> \in S, \left< \vec t \vec s \right> \in R \;\}$$ -

+

Not typically supported as a primitive operator,
but useful for expressing queries like:

+

Find species that appear in all boroughs

+
+ $$\pi_{BORONAME,\ SPC\_COMMON}(\textbf{Trees}) \;\;/\;\;\pi_{SPC\_COMMON}(\textbf{Trees})$$ + (using set relational algebra) +
+

+ $$R / S \equiv \{\; \left<\vec t\right> \;|\; \forall \left<\vec s\right> \in S, \left< \vec t \vec s \right> \in R \;\}$$ +

+
+ +
+

Division ($/$)

+
Operator Symbol Duplicates?
Operator Symbol Creates Duplicates?
Selection $\sigma$ No
Projection $\pi$ Yes
Cross-product $\times$ No
+ + + + + + + + + + +
BORO SPC_COMMON
Brooklyn honeylocust
Brooklyn American linden
Brooklyn London planetree
Manhattan honeylocust
Manhattan American linden
Manhattan pin oak
Queens honeylocust
Queens American linden
Bronx honeylocust
+ + + + + + + +
+ / +
SPC_COMMON
honeylocust
+ + = +
BORO
Brooklyn
Manhattan
Queens
Bronx
+
+
+ / +
SPC_COMMON
honeylocust
American linden
+ + = +
BORO
Brooklyn
Manhattan
Queens
+
+
+ / +
SPC_COMMON
honeylocust
American linden
pin oak
+ + = +
BORO
Manhattan
+
+
+
+ +
+

Group Work

+

If time permits: Implement division using other operators.

+
-
- - - - - - - - - - - -
BORO SPC_COMMON
Brooklyn honeylocust
Brooklyn American linden
Brooklyn London planetree
Manhattan honeylocust
Manhattan American linden
Manhattan pin oak
Queens honeylocust
Queens American linden
Bronx honeylocust
- - - - - -
/ { honeylocust } = Brooklyn, Manhattan, Queens, Bronx
/ { honeylocust, American linden } = Brooklyn, Manhattan, Queens
/ { honeylocust, American linden, pin oak }= Manhattan
-
- -
-

Group Work

-

If time permits: Implement division using other operators.

-
- - -

Relational Algebra

@@ -586,6 +620,7 @@ For each week:

+ diff --git a/slides/cse4562sp2019/2019-02-06-RA-Equivs.html b/slides/cse4562sp2019/2019-02-06-RA-Equivs.html new file mode 100644 index 00000000..af5072ed --- /dev/null +++ b/slides/cse4562sp2019/2019-02-06-RA-Equivs.html @@ -0,0 +1,464 @@ + + + + + + + CSE 4/562 + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + CSE 4/562 - Database Systems +
+ +
+ +
+

Relational Algebra Equivalences

+

CSE 4/562 – Database Systems

+
February 6, 2019
+
Textbook: Ch. 16.2
+
+ +
+
+

The running theme

+

+ If X and Y are equivalent and Y is better,
+ then replace all Xs with Ys
+

+ +

Today's focus: Provable Equivalence for RA Expressions

+
+ +
+

Equivalence

+ $$Q_1 = \pi_{A}\left( \sigma_{c}( R ) \right)$$ + $$Q_2 = \sigma_{c}\left( \pi_{A}( R ) \right)$$ + +
+ $$Q_1 \stackrel{?}{\equiv} Q_2$$ +
+ +
+ +
+

Ground Rules

+
+
Only Relational Values Matter
+
Obviously $Q_1 \neq Q_2$. What we care about is whether $Q_1(R) = Q_2(R)$...
+ +
Data Independent
+
... for all valid input data $R$.
+
However, it's fair to talk about equivalence when we know the data has some properties. (more on this later)
+ +
Data-Model Dependent
+
It's important to be clear whether we're talking about sets, bags, or lists.
+
+
+ +
+

In summary...

+ +

+ We say that $Q_1 \equiv Q_2$ if and only if
+ we can guarantee that the bag of tuples produced by $Q_1(R, S, T, \ldots)$
+ is the same as the bag of tuples produced by $Q_2(R, S, T, \ldots)$
+ for any combination of valid inputs $R, S, T, \ldots$. +

+

+ ... that satisfy any necessary properties. +

+
+ +
+

Starting Rules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Selection
$\sigma_{c_1 \wedge c_2}(R) \equiv \sigma_{c_1}(\sigma_{c_2}(R))$(Decomposability)
Projection
$\pi_{A}(R) \equiv \pi_{A}(\pi_{A \cup B}(R))$(Idempotence)
Cross Product
$R \times (S \times T) \equiv (R \times S) \times T$(Associativity)
$R \times S \equiv S \times R$(Commutativity)
Union
$R \cup (S \cup T) \equiv (R \cup S) \cup T$(Associativity)
$R \cup S \equiv S \cup R$(Commutativity)
+
+ +
+

Try it!

+ +

+ Show that + $$R \times (S \times T) \equiv T \times (S \times R)$$ +

+ + +
+

+ Show that + $$\sigma_{c_1}(\sigma_{c_2}(R)) \equiv \sigma_{c_2}(\sigma_{c_1}(R))$$ +

+
+ +
+

+ Show that + $$R \bowtie_{c} S \equiv S \bowtie_{c} R$$ +

+
+ +

+ Show that + $$\sigma_{R.B = S.B \wedge R.A > 3}(R \times S) \equiv \sigma_{R.A > 3}(R \bowtie_{B} S)$$ +

+ +
+
+ +
+
+

Rules for Multiple Operators

+
+ +
+ + + + + + +
Selection + Projection
$\pi_{A}(\sigma_{c}(R)) \equiv \sigma_{c}(\pi_{A}(R))$(Commutativity)
+

... but only if $A$ and $c$ are compatible

+

$A$ must include all columns referenced by $c$ ($cols(c)$)

+ +
+

Try it!

+

+ Show that + $$\pi_A(\sigma_c(R)) \equiv \pi_A(\sigma_c(\pi_{(A \cup cols(c))}(R)))$$ +

+
+
+ +
+ + + + + + +
Selection + Cross Product
$\sigma_c(R \times S) \equiv (\sigma_{c}(R)) \times S$(Commutativity)
+

... but only if $c$ references only columns of $R$

+

$cols(c) \subseteq cols(R)$

+ +
+

Try it!

+

+ Show that + $$\sigma_{R.B = S.B \wedge R.A > 3}(R \times S) \equiv (\sigma_{R.A > 3}(R)) \bowtie_{B} S$$ +

When is this rewrite a good idea?
+

+
+
+ +
+ + + + + + +
Projection + Cross Product
$\pi_A(R \times S) \equiv (\pi_{A_R}(R)) \times (\pi_{A_S}(S))$(Commutativity)
+

... where $A_R$ and $A_S$ are the columns of $A$ from $R$ and $S$ respectively.

+

$A_R = A \cap cols(R)$     $A_S = A \cap cols(S)$

+ +
+

Try it!

+

+ Show that + $$\pi_{A}(R \bowtie_c S) \equiv (\pi_{A_R}(R)) \bowtie_c (\pi_{A_S}(S))$$ +

When does this condition hold?
+

+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Intersection
$R \cap (S \cap T) \equiv (R \cap S) \cap T$(Associativity)
$R \cap S \equiv S \cap R$(Commutativity)
Selection +     
$\sigma_c(R \cup S) \equiv (\sigma_c(R)) \cup (\sigma_c(R))$(Commutativity)
$\sigma_c(R \cap S) \equiv (\sigma_c(R)) \cap (\sigma_c(R))$(Commutativity)
Projection +     
$\pi_A(R \cup S) \equiv (\pi_A(R)) \cup (\pi_A(R))$(Commutativity)
$\pi_A(R \cap S) \equiv (\pi_A(R)) \cap (\pi_A(R))$(Commutativity)
Cross Product + Union
$R \times (S \cup T) \equiv (R \times S) \cup (R \times T)$(Distributivity)
+
+
+ +
+
+

Example

+

+    SELECT R.A, T.E
+
+      FROM R, S, T
+
+     WHERE R.B = S.B
+       AND S.C < 5
+       AND S.D = T.D
+          
+ + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+
+ +
+
+

General Query Optimizers

+ +

Input: Dumb translation of SQL to RA

+

⬇︎

+

Apply rewrites

+

⬇︎

+

Output: Better, but equivalent query

+
+ +
+

Which rewrite rules should we apply?

+
+ +
+
+
Selection Pushdown
+
Always commute Selections as close to the leaves as possible.
+ +
Join Construction
+
Joins are always better than cross-products. (if there's a good join algorithm)
+ +
(Optional) Projection Pushdown
+
Commuting Projections down to the leaves removes redundant columns, and may be beneficial for some systems.
+ +
Join Algorithm Selection
+
Joins can be implemented differently, depending on the join predicate.
+ +
Join/Union Ordering
+
The order in which joins are evaluated may affect query runtimes.
+ +
Access Paths
+
$(\sigma_c(R))$ and $(Q(\ldots) \bowtie_c R)$ are special cases that we can make fast!
+
+

Some rewrites are situational... we need more information to decide when to apply them.

+
+ +
+

General Query Optimizers

+
    +
  1. Apply blind heuristics (e.g., push down selections)
  2. +
  3. Enumerate all possible execution plans by varying (or for a reasonable subset) +
      +
    • Join/Union Evaluation Order (commutativity, associativity, distributivity)
    • +
    • Algorithms for Joins, Aggregates, Sort, Distinct, and others
    • +
    • Data Access Paths
    • +
    +
  4. +
  5. Estimate the cost of each execution plan
  6. +
  7. Pick the execution plan with the lowest cost
  8. +
+
+ +
+ Next Class: Extended Relational Algebra and Basic Join Algorithms +
+
+ + +
+ + + + + + + diff --git a/slides/cse4562sp2019/2019-02-08-Checkpoint1.html b/slides/cse4562sp2019/2019-02-08-Checkpoint1.html index 26402bbd..4aaf726a 100644 --- a/slides/cse4562sp2019/2019-02-08-Checkpoint1.html +++ b/slides/cse4562sp2019/2019-02-08-Checkpoint1.html @@ -55,156 +55,449 @@
-

Intro

+

Checkpoint 1

CSE 4/562 – Database Systems

-
February 01, 2019
+
February 8, 2019
Textbook: Ch. 16.1
-
-
    -
  • Using CCJSQLParser
  • -
  • Using SQL ASTs
  • -
  • Select Statements
  • -
  • Create Table Statements
  • -
+
    +
  • Requirements Overview
  • +
  • CREATE TABLE
  • +
  • Volcano Evaluation
  • +
  • EvalLib
  • +
-
-

Using CCJSqlParser

+
+

Checkpoint 1

-

-	// StringReaders create a reader from a string 
-	Reader input = new StringReader("SELECT * FROM R")
+				
+					
+					
+					
+						sif$
+						
+							javac -cp build:jsqlparser.jar:evallib.jar -D build {all .java files}
+							sif$
+						
+					
+					
+						ls data/
+						R.csv      S.csv     T.csv
+						sif$
+					
+					
+						head -n 2 data/R.csv
+						1|3|5
+						2|9|1
+						sif$
+					
+					
+						java -cp build:jsqlparser.jar:evallib.jar dubstep.Main
 -
+						$>
+					
+					
+						CREATE TABLE R(A int, B int, C int);
+						$>
+					
+					
+						SELECT A, C FROM R WHERE B < 5;
+						1|5
+						...
+						$>
+					
+				
+			
+
+

Checkpoint 1

+
    +
  • Your code compiled just the same as in Checkpoint 0.
  • +
  • Print a prompt '$>' at the start and after each command.
  • +
  • CREATE TABLE statements tell you the schema of each table.
  • +
  • Data lives in a '|'-separated file in 'data/[tablename].csv'
  • +
  • Print query results '|'-separated
  • +
+
+
+
+
+ + + + → SQL + + +
CREATE TABLE PLAYERS(
+  ID string, 
+  FIRSTNAME string, 
+  LASTNAME string, 
+  FIRSTSEASON int, 
+  LASTSEASON int, 
+  WEIGHT int, 
+  BIRTHDATE date
+);
 
-	// CCJSqlParser takes a Reader or InputStream
-	CCJSqlParser parser = new CCJSqlParser(input)
+SELECT FIRSTNAME, LASTNAME, 
+       WEIGHT, BIRTHDATE 
+FROM PLAYERS 
+WHERE WEIGHT>200;
+
+
+ + + + → SQL + + + CREATE TABLE + + + + SELECT + + + +
CREATE TABLE PLAYERS(
+  ID string, 
+  FIRSTNAME string, 
+  LASTNAME string, 
+  FIRSTSEASON int, 
+  LASTSEASON int, 
+  WEIGHT int, 
+  BIRTHDATE date
+);
+ ↓ +

There is a table named "PLAYERS"... +

    +
  • ... with 7 attributes
  • +
  • ... who's attributes have the given types
  • +
  • ... with data in the file "data/PLAYERS.csv"
  • +
+

+
+
+ + + + → SQL + + + CREATE TABLE + + + + + Saved Schema + + + + .csv + + + + + SELECT + + + +
+ABDELAL01|Alaa|Abdelnaby|1990|1994|240|1968-06-24
+ABDULKA01|Kareem|Abdul-jabbar|1969|1988|225|1947-04-16
+ABDULMA01|Mahmo|Abdul-rauf|1990|2000|162|1969-03-09
+ABDULTA01|Tariq|Abdul-wahad|1997|2002|223|1974-11-03
+ABDURSH01|Shareef|Abdur-rahim|1996|2007|225|1976-12-11
+ABERNTO01|Tom|Abernethy|1976|1980|220|1954-05-06
+ABRAMJO01|John|Abramovic|1946|1947|195|1919-02-09
+ACKERAL01|Alex|Acker|2005|2008|185|1983-01-21
+ACKERDO01|Donald|Ackerman|1953|1953|183|1930-09-04
+ACRESMA01|Mark|Acres|1987|1992|220|1962-11-15
+ACTONCH01|Charles|Acton|1967|1967|210|1942-01-11
+...		
+
+
+ + + + → SQL + + + CREATE TABLE + + + + + Saved Schema + + + + .csv + + + + + + + + SELECT + + + + + + + Results + + + + + +

Example Queries

+
    +
  1. SELECT A, B, ... FROM R (Project)
  2. +
  3. SELECT A, B, ... FROM R WHERE ... (Project+Filter)
  4. +
  5. SELECT A+B AS C, ... FROM R (Map)
  6. +
  7. SELECT A+B AS C, ... FROM R WHERE ... (Map+Filter)
  8. +
  9. SELECT SUM(A+B) AS C, ... FROM R (Aggregate)
  10. +
  11. SELECT SUM(A+B) AS C, ... FROM R WHERE ... (Aggregate+Filter)
  12. +
+
+
+ + + + → SQL + + + CREATE TABLE + + + + + Saved Schema + + + + .csv + + + + + + + + SELECT + + + + + + + Results + + + + + +
    if(stmt instanceof Select){
+      SelectBody bodyBase = ((Select)stmt).getSelectBody();
+      if(bodyBase instanceof PlainSelect){
+        PlainSelect body = (PlainSelect)bodyBase;
+        ...
+        body.getFromItem()
+        body.getWhere()
+        body.getSelectItems()
+        ...
+      }
+    }
+
+
+ + + + → SQL + + + CREATE TABLE + + + + + Saved Schema + + + + .csv + + + + + + + + + + + SELECT + + + + + + + Iterators + + + + + + + Results + + + + + + + +
+
- // CCJSqlParser.Statement() returns the next - // complete Statement object from the reader or - // input stream (or null if the stream is empty). - Statement statement = parser.Statement() -
-
-
-

Using CCJSqlParser

- -

-	// System.in is an InputStream
-	CCJSqlParser parser = new CCJSqlParser(System.in)
-
-	Statement statement = parser.Statement();
-	// loop until you hit the last statement
-	while(statement != null){
-
-	  //
-	  // Do something with statement
-	  // 
-
-	  // ... then read the next statement
-	  statement = parser.Statement();
-	}
-		
-
-
- -
-
-

Abstract Syntax Trees

- - -
- -
-

-  while(statement != null){
-    if(statement instanceof Select){
-      Select select = (Select)statement;
-      // Do something with `select`
-
-    } else if(statement instanceof CreateTable){
-      CreateTable create = (CreateTable)statement;
-      // Do something with `create`
-
-    } else {
-      throw new SqlException("Can't handle: "+statement);
+		
+
+

Iterators

+

There are a number of data transformations that appear in more than one pattern. For example: +

    +
  1. Loading the CSV file in as data
  2. +
  3. Filtering rows out of data
  4. +
  5. Transforming (mapping) data into a new structure
  6. +
  7. Summarizing (aggregating) data
  8. +
  9. Printing output data
  10. +
+

+

Suggestion: Abstract these steps out

+
+
+

Idea: Functions

+
    +
  1. loadCSV(...) returns a table
  2. +
  3. filter(condition, table) returns a table
  4. +
  5. map(expressions, table) returns a table
  6. +
  7. aggregate(aggregates, table) returns a row
  8. +
  9. print(table)
  10. +
+

+

Problem: A "table" can get very very big.

+
+
+

Better Idea: Iterators

+
+
hasNext()
+
Returns true if there are more rows to return
+
next()
+
Returns the next row
+
+

All "functions" can be implemented as iterators that use constant space

+
+
+

Example: SelectOperator

+

+class SelectOperator implements RAOperator
+{
+    RAOperator child;
+    Expression condition;
+    public ProjectOperator(RAOperator child, Expression condition) {
+      this.child = child; this.condition = condition; 
     }
-    statement = parser.Statement()
-  }
-		
-
+ + public boolean hasNext(){ /* ...? */ } + public /* ...? */ next(){ /* ...? */ } +} +
+
+
+

'|'-separated Value File Suggestions

+ +
+
+ + + + + + + + +
SQL TypePrimitiveValue
stringStringValue
varcharStringValue
charStringValue
intLongValue
decimalDoubleValue
dateDateValue
+
+
-
-

-	Select select = (Select)statement;
-	SelectBody body = select.getSelectBody();
-	if(body instanceof /* ... */){
-	  // ...
+		
+
+

EvalLib

+

How do you evaluate the A > 5 in
SELECT B FROM R WHERE A > 5?

+

More generally, how do you evaluate a JSqlParser Expression?

+
+
+

+    Eval eval = new Eval(){ /* we'll get what goes here shortly */ }
+				
+ +

+	// Evaluate "1 + 2.0"
+	PrimitiveValue result;
+	result = 
+	  eval.eval(
+	    new Addition(
+	      new LongPrimitive(1),
+	      new DoublePrimitive(2.0)
+	    )
+	  ); 
+	System.out.println("Result: "+result); // "Result: 3.0"
+				
+
+ +
+

+	// Evaluate "R.A >= 5"
+	result =
+	  eval.eval(
+	    new GreaterThanEquals(
+	      new Column(new Table(null, "R"), "A"), // `R.A`
+	      new LongPrimitive(5)
+	    )
+	  );
+				
+

Problem: What value should EvalLib give to R.A?

+
+ +
+

Your code needs to tell it...

+

+	Eval eval = new Eval(){
+	  public PrimitiveValue eval(Column c){ 
+	    String colName = c.getColumnName();
+	    String tableName = c.getTable().getName();
+	    PrimitiveValue ret = /* look up colName.tableName */
+	    return ret;
+	  }
 	}
-		
-
    -
  • PlainSelect: (SELECT * FROM ...)
  • -
  • Union: (SELECT * FROM ...) UNION ALL (SELECT ...)
  • -
-
+
+
+ -
-

-	Select select = (Select)statement;
-	SelectBody body = select.getSelectBody();
-	if(body instanceof PlainSelect){
-	  PlainSelect plain = (PlainSelect)body;
-	  // Do something with `plain`
-	}
-		
-
- +
+

Questions?

+
-
-
-

PlainSelect

-

-	SELECT [distinct] [selectItems]
-	FROM [fromItem], [joins, ...]
-	WHERE [where]
-	GROUP BY [groupByColumnReferences]
-	HAVING [having]
-	ORDER BY [orderByElements]
-	LIMIT [limit]
-		
- Everything in [brackets] has a method in PlainSelect -
-
-

SelectItems

-
-
AllColumns
-
SELECT *
-
AllTableColumns
-
SELECT R.*
-
SelectExpressionItem
-
SELECT R.A or SELECT R.A AS Q
-
-
- -
-

Expressions

- - (To be discussed next week) -
-
diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-1.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-1.svg new file mode 100644 index 00000000..99938160 --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-1.svg @@ -0,0 +1,180 @@ + + + + + + + + + + image/svg+xml + + + + + + + σ(R.B=S.B)∧(S.C < 5)∧(S.D=T.D) + πR.A, T.E + + T + + + + + + + + R + S + + + + + + diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-2.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-2.svg new file mode 100644 index 00000000..3799f79e --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-2.svg @@ -0,0 +1,198 @@ + + + + + + + + + + image/svg+xml + + + + + + + σ(S.D=T.D) + πR.A, T.E + + T + + + + + + + + R + S + + + + + σ(R.B=S.B)∧(S.C < 5) + + + diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-3.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-3.svg new file mode 100644 index 00000000..49bb833c --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-3.svg @@ -0,0 +1,198 @@ + + + + + + + + + + image/svg+xml + + + + + + + σ(S.D=T.D) + πR.A, T.E + + T + + + + + + + + R + S + + + + + σ(R.B=S.B)∧(S.C < 5) + + + diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-4.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-4.svg new file mode 100644 index 00000000..3d7a7419 --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-4.svg @@ -0,0 +1,193 @@ + + + + + + + + + + image/svg+xml + + + + + + + πR.A, T.E + T + + + + + + + R + S + + + + + σ(R.B=S.B)∧(S.C < 5) + + S.D=T.D + + + diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-5.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-5.svg new file mode 100644 index 00000000..0bcd1fb1 --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-5.svg @@ -0,0 +1,211 @@ + + + + + + + + + + image/svg+xml + + + + + + + πR.A, T.E + T + + + + + + + R + S + + + + + σ(R.B=S.B) + + S.D=T.D + + σ(S.C < 5) + + + diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-6.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-6.svg new file mode 100644 index 00000000..46591f0e --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-6.svg @@ -0,0 +1,211 @@ + + + + + + + + + + image/svg+xml + + + + + + + πR.A, T.E + T + + + + + + + R + S + + + + + σ(R.B=S.B) + + S.D=T.D + + σ(S.C < 5) + + + diff --git a/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-7.svg b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-7.svg new file mode 100644 index 00000000..f4f4f8b1 --- /dev/null +++ b/slides/cse4562sp2019/graphics/2019-02-06-RA-Opt-7.svg @@ -0,0 +1,195 @@ + + + + + + + + + + image/svg+xml + + + + + + + πR.A, T.E + T + + + + + + R + S + + + + + S.D=T.D + + σ(S.C < 5) + + R.B=S.B + + diff --git a/slides/cse4562sp2019/graphics/Clipart/DB.png b/slides/cse4562sp2019/graphics/Clipart/DB.png new file mode 100644 index 00000000..90f993ef Binary files /dev/null and b/slides/cse4562sp2019/graphics/Clipart/DB.png differ diff --git a/slides/cse4562sp2019/graphics/Clipart/File.png b/slides/cse4562sp2019/graphics/Clipart/File.png new file mode 100644 index 00000000..5bde59da Binary files /dev/null and b/slides/cse4562sp2019/graphics/Clipart/File.png differ diff --git a/slides/cse4562sp2019/graphics/Clipart/Server.png b/slides/cse4562sp2019/graphics/Clipart/Server.png new file mode 100644 index 00000000..574dbffd Binary files /dev/null and b/slides/cse4562sp2019/graphics/Clipart/Server.png differ diff --git a/slides/cse4562sp2019/graphics/Clipart/Window.png b/slides/cse4562sp2019/graphics/Clipart/Window.png new file mode 100644 index 00000000..d6dce0cf Binary files /dev/null and b/slides/cse4562sp2019/graphics/Clipart/Window.png differ diff --git a/slides/cse4562sp2019/graphics/LabLogo-FullText-white.png b/slides/cse4562sp2019/graphics/LabLogo-FullText-white.png new file mode 100644 index 00000000..b3f42b46 Binary files /dev/null and b/slides/cse4562sp2019/graphics/LabLogo-FullText-white.png differ diff --git a/src/teaching/cse-562/2019sp/index.erb b/src/teaching/cse-562/2019sp/index.erb index f4e5f65f..1b886922 100644 --- a/src/teaching/cse-562/2019sp/index.erb +++ b/src/teaching/cse-562/2019sp/index.erb @@ -19,18 +19,21 @@ schedule: materials: slides: "https://odin.cse.buffalo.edu/slides/cse4562sp2019/2019-02-04-RA-Basics.html" - date: "Feb 6" - due: "Homework 1" topic: "Relational Algebra Equivalences" textbook: "16.2" + materials: + slides: "https://odin.cse.buffalo.edu/slides/cse4562sp2019/2019-02-06-RA-Equivs.html" - date: "Feb 8" due: "Checkpoint 0" topic: "Checkpoint 1" textbook: "Ch. 15.1-15.3, 16.3" + materials: + slides: "https://odin.cse.buffalo.edu/slides/cse4562sp2019/2019-02-08-Checkpoint1.html" - date: "Feb 11" - topic: "Evaluating Relational Algebra" + topic: "Basic Algorithms" textbook: "Ch. 15.1-15.5, 16.7" - date: "Feb 13" - due: "Homework 2" + due: "Homework 1" topic: "Extended Relational Algebra" textbook: "Ch. 5.2, 15.4" - date: "Feb 15" @@ -41,7 +44,7 @@ schedule: topic: "Indexing (Intro + Tree Indexes)" textbook: "Ch. 8.3-8.4, 14.1-14.2, 14.4" - date: "Feb 20" - due: "Homework 3" + due: "Homework 2" topic: "Indexing (Hash Indexes + Modern Indexes)" note: Learned indexes, LSM Trees textbook: "Ch. 14.3" @@ -57,7 +60,7 @@ schedule: topic: "Checkpoint 2" textbook: "Ch. 15.1-15.5, 16.2-16.3, 16.7" - date: "Feb 27" - due: "Homework 4" + due: "Homework 3" topic: "External (2-Pass) Algorithms (contd.)" textbook: "Ch. 15.4-15.5, 15.8" textbook: @@ -69,7 +72,7 @@ schedule: topic: "Database Statistics 1/2" textbook: "Ch. 16.4-16.5" - date: "Mar 6" - due: "Homework 5" + due: "Homework 4" topic: "Database Statistics 2/2" textbook: "Ch. 16.4-16.5" - date: "Mar 8" @@ -93,7 +96,7 @@ schedule: topic: "Materialized Views" textbook: "Ch. 8.5" - date: "Mar 27" - due: "Homework 6" + due: "Homework 5" topic: "SQL DDL and Constraints" textbook: "Ch. 7.1-7.4" - date: "Mar 29" @@ -106,7 +109,7 @@ schedule: - date: "Apr 3" topic: "Pessimistic Transaction Control" textbook: "Ch. 18.3-18.7, 19.2" - due: "Homework 7" + due: "Homework 6" - date: "Apr 5" topic: "Pessimistic Transaction Control (contd.)" textbook: "Ch. 18.3-18.7, 19.2" @@ -115,7 +118,7 @@ schedule: topic: "Checkpoint 4" textbook: "Ch. 15.7, 16.4-16.6" - date: "Apr 10" - due: "Homework 8" + due: "Homework 7" topic: "Optimistic Transaction Control" textbook: "Ch. 18.8-18.9" - date: "Apr 12" @@ -125,7 +128,7 @@ schedule: topic: "Logging + ARIES Recovery (contd.)" textbook: "Ch. 17.1-17.5" - date: "Apr 17" - due: "Homework 9" + due: "Homework 8" topic: "Distributed Algorithms" textbook: "Ch. 20.1-20.4" - date: "Apr 19" @@ -135,7 +138,7 @@ schedule: topic: "Distributed Updates" textbook: "Ch. 20.5-20.6" - date: "Apr 24" - due: "Homework 10" + due: "Homework 9" topic: "Distributed Updates (contd.)" textbook: "Ch. 20.5-20.6" - date: "Apr 26" @@ -145,12 +148,12 @@ schedule: topic: "Approximate Query Processing" textbook: "Ch. 23.5" - date: "May 1" - due: "Homework 11" + due: "Homework 10" topic: "Provenance Queries" - date: "May 3" topic: "Provenance for Uncertainty" - date: "May 6" - due: "Homework 12" + due: "Homework 11" topic: "Buffer Day" - date: "May 8" topic: "Final Exam Review 1"