-
-
- $$\texttt{WHEN } \mathcal D \leftarrow \mathcal{D}+\Delta\mathcal D \texttt{ DO:}~~~~\\
- \texttt{VIEW} \leftarrow \texttt{VIEW} + \Delta Q(\mathcal D,\Delta\mathcal D)$$
-
-
-
- $\Delta Q$ |
- (ideally) Small & fast query |
-
-
- $+$ |
- (ideally) Fast "merge" operation |
-
-
-
-
-
- Intuition
-
- $$\mathcal{R} = \{\ \textbf{A, B, C}\ \},\ \mathcal S = \{\ \textbf{X, Y}\ \} ~~~\Delta\mathcal{R} = \{\ \textbf{D}\ \}$$
- $$Q(\mathcal R, \mathcal S) = \texttt{COUNT}(\mathcal R \times \mathcal S)$$
-
-
-
$$ \texttt{COUNT}(\textbf{AX, AY, BX, BY, CX, CY, }\underline{\textbf{DX, DY}}) $$
-
$$Q(\mathcal R+\Delta\mathcal R, \mathcal S) \sim O( (|\mathcal R| + |\Delta\mathcal D|) \cdot |\mathcal S|)$$
-
-
-
$$ 6 + \texttt{COUNT}(\underline{\textbf{DX, DY}}) $$
-
$$\texttt{VIEW} + \texttt{COUNT}(\Delta\mathcal R \times \mathcal S) \sim O(|\Delta\mathcal R| \cdot |\mathcal S|)$$
-
-
-
-
- $\sigma(\mathcal R) \rightarrow \sigma(\mathcal R \uplus \Delta \mathcal R)$
-
- $ \equiv $
- $\sigma(\mathcal R)$
- $ \uplus $
- $\sigma(\Delta \mathcal R)$
-
-
-
$Q(\mathcal D) = \sigma(\mathcal R)$
-
$\Delta Q(\mathcal D, \Delta \mathcal D) = \sigma(\Delta \mathcal R)$
-
- Set/Bag difference also commutes through selection
-
-
-
- $\pi(\mathcal R) \rightarrow \pi(\mathcal R \uplus \Delta \mathcal R)$
-
- $ \equiv $
- $\pi(\mathcal R)$
- $ \uplus $
- $\pi(\Delta \mathcal R)$
-
-
-
$Q(\mathcal D) = \pi(\mathcal R)$
-
$\Delta Q(\mathcal D, \Delta \mathcal D) = \pi(\Delta \mathcal R)$
-
- Does this work under set semantics?
-
-
-
- $\mathcal R_1 \uplus \mathcal R_2 \rightarrow \mathcal R_1 \uplus \Delta \mathcal R_1 \uplus \mathcal R_2 \uplus \Delta \mathcal R_2$
-
- $ \equiv $
- $\mathcal R_1 \uplus \mathcal R_2$
- $ \uplus $
- $\Delta \mathcal R_1 \uplus \Delta \mathcal R_2$
-
-
-
$Q(\mathcal D) = \mathcal R_1 \uplus \mathcal R_2$
-
$\Delta Q(\mathcal D, \Delta \mathcal D) = \Delta \mathcal R_1 \uplus \Delta \mathcal R_2$
-
-
-
-
-
- $$(\mathcal R_1 \uplus \Delta \mathcal R_1) \times (\mathcal R_2 \uplus \Delta \mathcal R_2)$$
-
-
- $$\left(\mathcal R_1 \times (\mathcal R_2 \uplus \Delta \mathcal R_2)\right) \uplus \left(\Delta \mathcal R_1 \times (\mathcal R_2 \uplus \Delta \mathcal R_2)\right)$$
-
-
- $$\left(\mathcal R_1 \times \mathcal R_2\right) \uplus \left(\mathcal R_1 \times \Delta \mathcal R_2\right) \uplus \left(\Delta \mathcal R_1 \times (\mathcal R_2 \uplus \Delta \mathcal R_2)\right)$$
-
-
- $$\left(\mathcal R_1 \times \mathcal R_2\right) \uplus \left(\mathcal R_1 \times \Delta \mathcal R_2\right) \uplus \left(\Delta \mathcal R_1 \times \mathcal R_2\right) \uplus \left(\Delta \mathcal R_1 \times \Delta \mathcal R_2\right)$$
-
-
-
diff --git a/src/teaching/cse-562/2021sp/slide/2021-05-06-Review2.erb b/src/teaching/cse-562/2021sp/slide/2021-05-06-Review2.erb
index ed914415..345631a2 100644
--- a/src/teaching/cse-562/2021sp/slide/2021-05-06-Review2.erb
+++ b/src/teaching/cse-562/2021sp/slide/2021-05-06-Review2.erb
@@ -9,6 +9,101 @@ dependencies:
require "slide_utils.rb"
%>
+
+
+
+ $$\texttt{WHEN } \mathcal D \leftarrow \mathcal{D}+\Delta\mathcal D \texttt{ DO:}~~~~\\
+ \texttt{VIEW} \leftarrow \texttt{VIEW} + \Delta Q(\mathcal D,\Delta\mathcal D)$$
+
+
+
+ $\Delta Q$ |
+ (ideally) Small & fast query |
+
+
+ $+$ |
+ (ideally) Fast "merge" operation |
+
+
+
+
+
+ Intuition
+
+ $$\mathcal{R} = \{\ \textbf{A, B, C}\ \},\ \mathcal S = \{\ \textbf{X, Y}\ \} ~~~\Delta\mathcal{R} = \{\ \textbf{D}\ \}$$
+ $$Q(\mathcal R, \mathcal S) = \texttt{COUNT}(\mathcal R \times \mathcal S)$$
+
+
+
$$ \texttt{COUNT}(\textbf{AX, AY, BX, BY, CX, CY, }\underline{\textbf{DX, DY}}) $$
+
$$Q(\mathcal R+\Delta\mathcal R, \mathcal S) \sim O( (|\mathcal R| + |\Delta\mathcal D|) \cdot |\mathcal S|)$$
+
+
+
$$ 6 + \texttt{COUNT}(\underline{\textbf{DX, DY}}) $$
+
$$\texttt{VIEW} + \texttt{COUNT}(\Delta\mathcal R \times \mathcal S) \sim O(|\Delta\mathcal R| \cdot |\mathcal S|)$$
+
+
+
+
+ $\sigma(\mathcal R) \rightarrow \sigma(\mathcal R \uplus \Delta \mathcal R)$
+
+ $ \equiv $
+ $\sigma(\mathcal R)$
+ $ \uplus $
+ $\sigma(\Delta \mathcal R)$
+
+
+
$Q(\mathcal D) = \sigma(\mathcal R)$
+
$\Delta Q(\mathcal D, \Delta \mathcal D) = \sigma(\Delta \mathcal R)$
+
+ Set/Bag difference also commutes through selection
+
+
+
+ $\pi(\mathcal R) \rightarrow \pi(\mathcal R \uplus \Delta \mathcal R)$
+
+ $ \equiv $
+ $\pi(\mathcal R)$
+ $ \uplus $
+ $\pi(\Delta \mathcal R)$
+
+
+
$Q(\mathcal D) = \pi(\mathcal R)$
+
$\Delta Q(\mathcal D, \Delta \mathcal D) = \pi(\Delta \mathcal R)$
+
+ Does this work under set semantics?
+
+
+
+ $\mathcal R_1 \uplus \mathcal R_2 \rightarrow \mathcal R_1 \uplus \Delta \mathcal R_1 \uplus \mathcal R_2 \uplus \Delta \mathcal R_2$
+
+ $ \equiv $
+ $\mathcal R_1 \uplus \mathcal R_2$
+ $ \uplus $
+ $\Delta \mathcal R_1 \uplus \Delta \mathcal R_2$
+
+
+
$Q(\mathcal D) = \mathcal R_1 \uplus \mathcal R_2$
+
$\Delta Q(\mathcal D, \Delta \mathcal D) = \Delta \mathcal R_1 \uplus \Delta \mathcal R_2$
+
+
+
+
+
+ $$(\mathcal R_1 \uplus \Delta \mathcal R_1) \times (\mathcal R_2 \uplus \Delta \mathcal R_2)$$
+
+
+ $$\left(\mathcal R_1 \times (\mathcal R_2 \uplus \Delta \mathcal R_2)\right) \uplus \left(\Delta \mathcal R_1 \times (\mathcal R_2 \uplus \Delta \mathcal R_2)\right)$$
+
+
+ $$\left(\mathcal R_1 \times \mathcal R_2\right) \uplus \left(\mathcal R_1 \times \Delta \mathcal R_2\right) \uplus \left(\Delta \mathcal R_1 \times (\mathcal R_2 \uplus \Delta \mathcal R_2)\right)$$
+
+
+ $$\left(\mathcal R_1 \times \mathcal R_2\right) \uplus \left(\mathcal R_1 \times \Delta \mathcal R_2\right) \uplus \left(\Delta \mathcal R_1 \times \mathcal R_2\right) \uplus \left(\Delta \mathcal R_1 \times \Delta \mathcal R_2\right)$$
+
+
+
+
+