mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-09-10 19:15:25 +02:00
[DMDB] Improved quick overview
Fixes sectioning, better variables in query processing section, checklist linking
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
\newpage
|
||||
\subsection{Query Processing}
|
||||
\subsubsection{Sorting}
|
||||
Given $B$ frames of memory and $N$ records, we have (typically I/Os in pages to be read)
|
||||
@@ -12,15 +13,15 @@ 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) - 1 + \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 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$.
|
||||
\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.
|
||||
\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,
|
||||
$\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.
|
||||
\item \bi{Hash Index}: Cost is $1 + \texttt{cnt}(R') \div L_L + \texttt{cnt}(R')$, where the $1$ is to do the lookup,
|
||||
$\texttt{cnt}(R') \div R_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 R_F$ as minimum, for clustered index), with $R_L$ the number of records per Leaf and $R_F$ the number of records per file.
|
||||
\end{itemize}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user