Moving materialized views to Thursday

This commit is contained in:
Oliver Kennedy 2021-05-04 22:40:28 -04:00
parent 79d3ad5bf9
commit 98834771fc
Signed by: okennedy
GPG key ID: 3E5F9B3ABD3FDB60
2 changed files with 95 additions and 94 deletions

View file

@ -686,97 +686,3 @@ dependencies:
</dl>
</section>
</section>
<section>
<section>
<div style="font-size: 100%;">
$$\texttt{WHEN } \mathcal D \leftarrow \mathcal{D}+\Delta\mathcal D \texttt{ DO:}~~~~\\
\texttt{VIEW} \leftarrow \texttt{VIEW} + \Delta Q(\mathcal D,\Delta\mathcal D)$$
</div>
<table style="margin-top: 50px;">
<tr class="fragment">
<td style="font-size: 100%;">$\Delta Q$</td>
<td>(ideally) Small &amp; fast query</td>
</tr>
<tr class="fragment">
<td style="font-size: 100%;">$+$</td>
<td>(ideally) Fast "merge" operation</td>
</tr>
</table>
</section>
<section>
<h3>Intuition</h3>
<div>
$$\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)$$
</div>
<div style="margin-top: 50px;">
<div class="fragment">$$ \texttt{COUNT}(\textbf{AX, AY, BX, BY, CX, CY, }\underline{\textbf{DX, DY}}) $$</div>
<div class="fragment">$$Q(\mathcal R+\Delta\mathcal R, \mathcal S) \sim O( (|\mathcal R| + |\Delta\mathcal D|) \cdot |\mathcal S|)$$</div>
</div>
<div style="margin-top: 50px;">
<div class="fragment">$$ 6 + \texttt{COUNT}(\underline{\textbf{DX, DY}}) $$</div>
<div class="fragment">$$\texttt{VIEW} + \texttt{COUNT}(\Delta\mathcal R \times \mathcal S) \sim O(|\Delta\mathcal R| \cdot |\mathcal S|)$$</div>
</div>
</section>
<section>
<p>$\sigma(\mathcal R) \rightarrow \sigma(\mathcal R \uplus \Delta \mathcal R)$</p>
<p class="fragment" data-fragment-index="1">
$ \equiv $
<span class="fragment highlight-red" data-fragment-index="2">$\sigma(\mathcal R)$</span>
$ \uplus $
<span class="fragment highlight-blue" data-fragment-index="3">$\sigma(\Delta \mathcal R)$</span>
</p>
<div style="margin-top: 50px; font-size: 80%;">
<p class="fragment" data-fragment-index="2" style="color: red;">$Q(\mathcal D) = \sigma(\mathcal R)$</p>
<p class="fragment" data-fragment-index="3" style="color: #1b91ff;">$\Delta Q(\mathcal D, \Delta \mathcal D) = \sigma(\Delta \mathcal R)$</p>
</div>
<p class="fragment" data-fragment-index="4">Set/Bag difference also commutes through selection</p>
</section>
<section>
<p>$\pi(\mathcal R) \rightarrow \pi(\mathcal R \uplus \Delta \mathcal R)$</p>
<p class="fragment" data-fragment-index="1">
$ \equiv $
<span class="fragment highlight-red" data-fragment-index="2">$\pi(\mathcal R)$</span>
$ \uplus $
<span class="fragment highlight-blue" data-fragment-index="3">$\pi(\Delta \mathcal R)$</span>
</p>
<div style="margin-top: 50px; font-size: 80%;">
<p class="fragment" data-fragment-index="2" style="color: red;">$Q(\mathcal D) = \pi(\mathcal R)$</p>
<p class="fragment" data-fragment-index="3" style="color: #1b91ff;">$\Delta Q(\mathcal D, \Delta \mathcal D) = \pi(\Delta \mathcal R)$</p>
</div>
<p class="fragment" data-fragment-index="4">Does this work under set semantics?</p>
</section>
<section>
<p>$\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$</p>
<p class="fragment" data-fragment-index="1">
$ \equiv $
<span class="fragment highlight-red" data-fragment-index="2">$\mathcal R_1 \uplus \mathcal R_2$</span>
$ \uplus $
<span class="fragment highlight-blue" data-fragment-index="3">$\Delta \mathcal R_1 \uplus \Delta \mathcal R_2$</span>
</p>
<div style="margin-top: 50px; font-size: 80%;">
<p class="fragment" data-fragment-index="2" style="color: red;">$Q(\mathcal D) = \mathcal R_1 \uplus \mathcal R_2$</p>
<p class="fragment" data-fragment-index="3" style="color: #1b91ff;">$\Delta Q(\mathcal D, \Delta \mathcal D) = \Delta \mathcal R_1 \uplus \Delta \mathcal R_2$</p>
</div>
</section>
<section>
<div>
$$(\mathcal R_1 \uplus \Delta \mathcal R_1) \times (\mathcal R_2 \uplus \Delta \mathcal R_2)$$
</div>
<div style="margin-top: 50px;" class="fragment">
$$\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)$$
</div>
<div style="margin-top: 50px;" class="fragment">
$$\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)$$
</div>
<div style="margin-top: 50px; font-size: 90%" class="fragment">
$$\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)$$
</div>
</section>
</section>

View file

@ -9,6 +9,101 @@ dependencies:
require "slide_utils.rb"
%>
<section>
<section>
<div style="font-size: 100%;">
$$\texttt{WHEN } \mathcal D \leftarrow \mathcal{D}+\Delta\mathcal D \texttt{ DO:}~~~~\\
\texttt{VIEW} \leftarrow \texttt{VIEW} + \Delta Q(\mathcal D,\Delta\mathcal D)$$
</div>
<table style="margin-top: 50px;">
<tr class="fragment">
<td style="font-size: 100%;">$\Delta Q$</td>
<td>(ideally) Small &amp; fast query</td>
</tr>
<tr class="fragment">
<td style="font-size: 100%;">$+$</td>
<td>(ideally) Fast "merge" operation</td>
</tr>
</table>
</section>
<section>
<h3>Intuition</h3>
<div>
$$\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)$$
</div>
<div style="margin-top: 50px;">
<div class="fragment">$$ \texttt{COUNT}(\textbf{AX, AY, BX, BY, CX, CY, }\underline{\textbf{DX, DY}}) $$</div>
<div class="fragment">$$Q(\mathcal R+\Delta\mathcal R, \mathcal S) \sim O( (|\mathcal R| + |\Delta\mathcal D|) \cdot |\mathcal S|)$$</div>
</div>
<div style="margin-top: 50px;">
<div class="fragment">$$ 6 + \texttt{COUNT}(\underline{\textbf{DX, DY}}) $$</div>
<div class="fragment">$$\texttt{VIEW} + \texttt{COUNT}(\Delta\mathcal R \times \mathcal S) \sim O(|\Delta\mathcal R| \cdot |\mathcal S|)$$</div>
</div>
</section>
<section>
<p>$\sigma(\mathcal R) \rightarrow \sigma(\mathcal R \uplus \Delta \mathcal R)$</p>
<p class="fragment" data-fragment-index="1">
$ \equiv $
<span class="fragment highlight-red" data-fragment-index="2">$\sigma(\mathcal R)$</span>
$ \uplus $
<span class="fragment highlight-blue" data-fragment-index="3">$\sigma(\Delta \mathcal R)$</span>
</p>
<div style="margin-top: 50px; font-size: 80%;">
<p class="fragment" data-fragment-index="2" style="color: red;">$Q(\mathcal D) = \sigma(\mathcal R)$</p>
<p class="fragment" data-fragment-index="3" style="color: #1b91ff;">$\Delta Q(\mathcal D, \Delta \mathcal D) = \sigma(\Delta \mathcal R)$</p>
</div>
<p class="fragment" data-fragment-index="4">Set/Bag difference also commutes through selection</p>
</section>
<section>
<p>$\pi(\mathcal R) \rightarrow \pi(\mathcal R \uplus \Delta \mathcal R)$</p>
<p class="fragment" data-fragment-index="1">
$ \equiv $
<span class="fragment highlight-red" data-fragment-index="2">$\pi(\mathcal R)$</span>
$ \uplus $
<span class="fragment highlight-blue" data-fragment-index="3">$\pi(\Delta \mathcal R)$</span>
</p>
<div style="margin-top: 50px; font-size: 80%;">
<p class="fragment" data-fragment-index="2" style="color: red;">$Q(\mathcal D) = \pi(\mathcal R)$</p>
<p class="fragment" data-fragment-index="3" style="color: #1b91ff;">$\Delta Q(\mathcal D, \Delta \mathcal D) = \pi(\Delta \mathcal R)$</p>
</div>
<p class="fragment" data-fragment-index="4">Does this work under set semantics?</p>
</section>
<section>
<p>$\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$</p>
<p class="fragment" data-fragment-index="1">
$ \equiv $
<span class="fragment highlight-red" data-fragment-index="2">$\mathcal R_1 \uplus \mathcal R_2$</span>
$ \uplus $
<span class="fragment highlight-blue" data-fragment-index="3">$\Delta \mathcal R_1 \uplus \Delta \mathcal R_2$</span>
</p>
<div style="margin-top: 50px; font-size: 80%;">
<p class="fragment" data-fragment-index="2" style="color: red;">$Q(\mathcal D) = \mathcal R_1 \uplus \mathcal R_2$</p>
<p class="fragment" data-fragment-index="3" style="color: #1b91ff;">$\Delta Q(\mathcal D, \Delta \mathcal D) = \Delta \mathcal R_1 \uplus \Delta \mathcal R_2$</p>
</div>
</section>
<section>
<div>
$$(\mathcal R_1 \uplus \Delta \mathcal R_1) \times (\mathcal R_2 \uplus \Delta \mathcal R_2)$$
</div>
<div style="margin-top: 50px;" class="fragment">
$$\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)$$
</div>
<div style="margin-top: 50px;" class="fragment">
$$\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)$$
</div>
<div style="margin-top: 50px; font-size: 90%" class="fragment">
$$\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)$$
</div>
</section>
</section>
<section>
<section>
<dl>