[DMDB] Add explanation to hash index complexity

This commit is contained in:
2026-08-05 10:22:46 +02:00
parent 944c8e8da4
commit 5b34c4f9e4
2 changed files with 3 additions and 2 deletions
Binary file not shown.
@@ -17,8 +17,9 @@ Given $B$ frames of memory and $N$ records, we ahve
\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.
\end{itemize}
\item \bi{Hash Index}: Cost is $1 + \texttt{cnt}(R') \div \texttt{cnt}(P_L) + \texttt{cnt}(R')$, where the $1$ is to do the lookup and
$\texttt{cnt}(R') \div P_L$, with $P_L$ the number of records per Leaf.
\item \bi{Hash Index}: Cost is $1 + \texttt{cnt}(R') \div \texttt{cnt}(P_L) + \texttt{cnt}(R')$, where the $1$ is to do the lookup,
$\texttt{cnt}(R') \div P_L$ to fetch the row IDs and $\texttt{cnt}(R')$ to fetch the records
(this is an up-to, it is $\texttt{cnt}(R') \div P_F$ as minimum, for clustered index), with $P_L$ the number of records per Leaf and $P_F$ the number of records per file.
\end{itemize}