From b9d755db51b64a71bad36d842f018663b7d9a595 Mon Sep 17 00:00:00 2001 From: Oliver Kennedy Date: Tue, 27 Feb 2018 22:13:48 -0500 Subject: [PATCH] Index costs --- .../2018-02-28-CostBasedOptimization1.html | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/slides/cse4562sp2018/2018-02-28-CostBasedOptimization1.html b/slides/cse4562sp2018/2018-02-28-CostBasedOptimization1.html index 4d26155a..b5141029 100644 --- a/slides/cse4562sp2018/2018-02-28-CostBasedOptimization1.html +++ b/slides/cse4562sp2018/2018-02-28-CostBasedOptimization1.html @@ -167,11 +167,21 @@ Sort $\tau(R)$ $0$ - $|R|$ + $O(|R|)$ $2 \cdot \lfloor log_{\mathcal B}(|R|) \rfloor$ - $\mathcal B$ + $O(\mathcal B)$ + + + Index Scan + $\sigma_c(R)$ + $\log_{\mathcal I}(|R|) + \frac{|\sigma_c(R)|}{\mathcal P}$ + $O(1)$ + + + $1$ + $O(1)$ @@ -179,6 +189,7 @@
  • Tuples per Page ($\mathcal P$) – Normally defined per-schema
  • Size of $R$ ($|R|$)
  • Pages of Buffer ($\mathcal B$)
  • +
  • Keys per Index Page ($\mathcal I$)
  • @@ -213,22 +224,33 @@ $O(1)$ + Sort - Aggregate - $\gamma_A(R)$ - $0$ - $adom(A)$ + Index Nested Loop + $R \bowtie_c S$ + $|R| \cdot (\log_{\mathcal I}(|S|) + \frac{|\sigma_c(S)|}{\mathcal P})$ + $O(1)$ - $0$ + Sort - $O(1)$ + Sort + $|R| \cdot 1$ + $O(1)$ + + + Aggregate + $\gamma_A(R)$ + $0$ + $adom(A)$ + + + $0$ + Sort + $O(1)$ + Sort -
      +
      1. Tuples per Page ($\mathcal P$) – Normally defined per-schema
      2. Size of $R$ ($|R|$)
      3. Pages of Buffer ($\mathcal B$)
      4. -
      5. Number of distinct values of $A$ ($adom(A)$)
      6. +
      7. Keys per Index Page ($\mathcal I$)
      8. +
      9. Number of distinct values of $A$ ($adom(A)$)