[DMDB] Much more intution on NF and FD

This commit is contained in:
2026-08-16 09:17:06 +02:00
parent 3907316926
commit a594a305d1
3 changed files with 65 additions and 1 deletions
@@ -12,7 +12,8 @@ Given $B$ frames of memory and $N$ records, we have (typically I/Os in pages to
\subsubsection{Selection}
\begin{itemize}
\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) + \texttt{cnt}(P_L) + \texttt{cnt}(P_F)$, $P_L$ the 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 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$.
\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 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.