[DMDB] Fix small errors in quick overview

This commit is contained in:
2026-08-17 10:05:34 +02:00
parent 6fbb1910a8
commit 74437211cb
2 changed files with 3 additions and 2 deletions
Binary file not shown.
@@ -15,6 +15,7 @@ Given $B$ frames of memory and $N$ records, we have (typically I/Os in pages to
\item \bi{File Scan}: $N \div P_F$, with $P_F$ the number of pages, because we need to run through all pages \item \bi{File Scan}: $N \div P_F$, with $P_F$ the number of pages, because we need to run through all pages
\item \bi{B+ Tree}: $\texttt{height}(T) - 1 + \texttt{cnt}(P_L) + \texttt{cnt}(P_F)$, $P_L$ the affected leaf pages and $P_F$ the file pages, \item \bi{B+ Tree}: $\texttt{height}(T) - 1 + \texttt{cnt}(P_L) + \texttt{cnt}(P_F)$, $P_L$ the affected leaf pages and $P_F$ the file pages,
the minus one comes from the fact that we count the leaf page already using $P_L$. the minus one comes from the fact that we count the leaf page already using $P_L$.
Note that $\texttt{height}(T) = 1 + \ceil{\log_K(P_L)}$, with $K$ the number of elements in the inner nodes
\begin{itemize} \begin{itemize}
\item For a clustered index, $\texttt{cnt}(P_F) = \texttt{cnt}(R') \div (F_L \cdot R_L)$, with $R_L$ the number of records per leaf page and $F_L$ the fill factor. \item For a clustered index, $\texttt{cnt}(P_F) = \texttt{cnt}(R') \div (F_L \cdot R_L)$, with $R_L$ the number of records per leaf page and $F_L$ the fill factor.
\item For an unclustered index, $\texttt{cnt}(P_F) = \texttt{cnt}(R')$, with $\texttt{cnt}(R') = \texttt{cnt}(R) \cdot S$, with $S$ the selectivity of the predicate. \item For an unclustered index, $\texttt{cnt}(P_F) = \texttt{cnt}(R')$, with $\texttt{cnt}(R') = \texttt{cnt}(R) \cdot S$, with $S$ the selectivity of the predicate.
@@ -29,8 +30,8 @@ Given $B$ frames of memory and $N$ records, we have (typically I/Os in pages to
Remember that we need the sort-based and hash-based approach to eliminate duplicates. Remember that we need the sort-based and hash-based approach to eliminate duplicates.
\begin{itemize} \begin{itemize}
\item \bi{Partitioning}: $\texttt{Cost}_\texttt{part}(R) = \texttt{cnt}(R) + \texttt{cnt}(R')$ with \item \bi{Partitioning}: $\texttt{Cost}_\texttt{part}(R) = \texttt{cnt}(R) + \texttt{cnt}(R')$ with
$\texttt{cnt}(R') = \texttt{cnt}(R) Q$, with $Q$ the fraction of selected attributes divided by total attributes $\texttt{cnt}(R') = \texttt{cnt}(R) \cdot Q$, with $Q$ the fraction of selected attributes divided by total attributes
\item \bi{Sort-Based}: The number of sorted runs are $M = \ceil{\texttt{cnt}(R') \div B}$, with the merge passes $P = \ceil{\log_{B - 1}(M)}$, total cost: \item \bi{Sort-Based}: The number of sorted runs are $M = \ceil{\texttt{cnt}(R') \div B}$, with the merge passes $P = 1 + \ceil{\log_{B - 1}(M)}$, total cost:
$2 \cdot N \cdot P + \texttt{Cost}_\texttt{part}(R)$ $2 \cdot N \cdot P + \texttt{Cost}_\texttt{part}(R)$
\item \bi{Hash-Based}: \item \bi{Hash-Based}:
\begin{itemize} \begin{itemize}