Skip to content

Commit 3303f49

Browse files
committed
Finish 'Background and motivation'
1 parent 164c1a7 commit 3303f49

5 files changed

+85
-19
lines changed

inconsistent_example.pdf

910 KB
Binary file not shown.

inconsistent_example.psd

1.24 MB
Binary file not shown.

vldb_sample.aux

+25-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
\relax
22
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}}
33
\@writefile{toc}{\contentsline {section}{\numberline {2}Background and motivation}{1}}
4+
\citation{kai:slimdb}
5+
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces LSM-tree ranges dump and compaction}}{2}}
6+
\newlabel{fig:compaction_schema}{{1}{2}}
7+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Compaction}{2}}
8+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}LSM-tree based table structure}{2}}
9+
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces LSM-tree based table inconsistency example}}{2}}
10+
\newlabel{fig:inconsistent_example}{{2}{2}}
11+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Multiple indexes update problem}{2}}
12+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Math Equations}{2}}
413
\citation{Lamport:LaTeX}
514
\citation{bowman:reasoning}
615
\citation{clark:pct}
@@ -11,35 +20,32 @@
1120
\citation{Lamport:LaTeX}
1221
\citation{Lamport:LaTeX}
1322
\citation{Lamport:LaTeX}
14-
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces LSM-tree ranges dump and compaction}}{2}}
15-
\newlabel{fig:compaction_schema}{{1}{2}}
16-
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Compaction}{2}}
17-
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Math Equations}{2}}
18-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.1}Inline (In-text) Equations}{2}}
19-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.2.2}Display Equations}{2}}
20-
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Citations}{2}}
21-
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Tables}{2}}
22-
\citation{salas:calculus}
23+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.1}Inline (In-text) Equations}{3}}
24+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.2}Display Equations}{3}}
25+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Citations}{3}}
26+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.6}Tables}{3}}
2327
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Frequency of Special Characters}}{3}}
24-
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces A sample black and white graphic (.pdf format).}}{3}}
25-
\newlabel{fig:fly}{{2}{3}}
26-
\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Figures}{3}}
27-
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces A sample black and white graphic (.pdf format) that has been resized with the \texttt {includegraphics} command.}}{3}}
28-
\newlabel{fig:bigfly}{{3}{3}}
29-
\@writefile{toc}{\contentsline {subsection}{\numberline {2.6}Theorem-like Constructs}{3}}
28+
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces A sample black and white graphic (.pdf format).}}{3}}
29+
\newlabel{fig:fly}{{3}{3}}
30+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.7}Figures}{3}}
31+
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces A sample black and white graphic (.pdf format) that has been resized with the \texttt {includegraphics} command.}}{3}}
32+
\newlabel{fig:bigfly}{{4}{3}}
33+
\citation{salas:calculus}
3034
\bibstyle{abbrv}
3135
\bibdata{vldb_sample}
3236
\bibcite{bowman:reasoning}{1}
3337
\bibcite{braams:babel}{2}
3438
\bibcite{clark:pct}{3}
3539
\bibcite{herlihy:methodology}{4}
3640
\bibcite{Lamport:LaTeX}{5}
37-
\bibcite{salas:calculus}{6}
41+
\bibcite{kai:slimdb}{6}
42+
\bibcite{salas:calculus}{7}
3843
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Some Typical Commands}}{4}}
39-
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces A sample black and white graphic (.pdf format) that needs to span two columns of text.}}{4}}
40-
\newlabel{fig:flies}{{4}{4}}
44+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.8}Theorem-like Constructs}{4}}
4145
\@writefile{toc}{\contentsline {section}{\numberline {3}Conclusions}{4}}
4246
\@writefile{toc}{\contentsline {section}{\numberline {4}Acknowledgments}{4}}
4347
\@writefile{toc}{\contentsline {section}{\numberline {5}References}{4}}
4448
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}References}{4}}
45-
\@writefile{toc}{\contentsline {section}{\numberline {A}Final Thoughts on Good Layout}{4}}
49+
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces A sample black and white graphic (.pdf format) that needs to span two columns of text.}}{5}}
50+
\newlabel{fig:flies}{{5}{5}}
51+
\@writefile{toc}{\contentsline {section}{\numberline {A}Final Thoughts on Good Layout}{5}}

vldb_sample.bib

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
@INPROCEEDINGS{kai:slimdb,
2+
AUTHOR = "Kai Ren and Qing Zheng and Joy Arulraj and Garth Gibson",
3+
TITLE = "SlimDB: A Space-Efficient Key-Value Storage Engine For Semi-Sorted Data",
4+
BOOKTITLE = "Proceedings of the VLDB Endowment",
5+
ORGANIZATION = "VLDB Endowment",
6+
MONTH = "August",
7+
YEAR = {2017},
8+
VOLUME = "{10}" }
9+
110
@ARTICLE{bowman:reasoning,
211
AUTHOR = "Mic Bowman and Saumya K. Debray and Larry L. Peterson",
312
TITLE = "Reasoning About Naming Systems",

vldb_sample.tex

+51
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,57 @@ \subsection{Compaction}
300300
key values into ranges, when each range stores and maintains its own sublevels
301301
independently of other ranges (see Figure \ref{fig:compaction_schema}).
302302

303+
\subsection{LSM-tree based table structure}
304+
In LSM-tree based table each index is an LSM-tree, sorted by the index parts.
305+
It is common pattern, that a table has one primary index and a number of
306+
secondary indexes. A primary index always is unique, and stores full tuples,
307+
including all indexed and not indexed fields, as they were inserted by an user.
308+
A secondary index stores only its own key parts and primary index parts to save
309+
memory. Such indexes are called non-covering. Primary parts are used as link to
310+
a full tuple in a primary index, when a search uses a secondary index only.
311+
312+
The described pattern is not unique feature of LSM-tree based tables. For
313+
example, SQLite secondary indexes based on B-tree are not covering by default
314+
too. And each SQLite table has unique primary index even if an user did not
315+
specified it explicitly.
316+
317+
Since secondary indexes stores primary index parts, they are linked with primary
318+
indexes. And if a tuple does not exist in a primary index, the same tuple can
319+
not exist in a secondary index. This is the reason, why hidden reads are
320+
indispensible - if a tuple is replaced with another secondary key or deleted
321+
from a primary index, then its old version must be deleted from each secondary
322+
index by old secondary key, else a table indexes are not consistent.
323+
324+
\subsection{Multiple indexes update problem}
325+
LSM-tree ability to manage multiple versions of a key allows to avoid hidden
326+
reads on such operations as replace or delete which can not break consistency if
327+
there is only a primary index in a table and no foreign key constraints.
328+
Such operations are known as \textbf{blind-writes} \cite{kai:slimdb}.
329+
Blind-writes are much faster than non-blind insert or update operations, which
330+
read an old tuple in a worst case from a disk to check for duplicate or apply
331+
update operations.
332+
333+
The big problem of LSM-tree based tables is that in presense of secondary
334+
indexes all writes become non-blind. See Figure \ref{fig:inconsistent_example}
335+
for example of inconsistency if replace is blind and a table has secondary
336+
index. Here a table is defined with 4 columns: first is part of a primary index,
337+
2 and 3 are parts of a secondary index, and 4 is not indexed.
338+
\textit{Replace\{1, 5, 6, 7\}} before executed must read old tuple from a
339+
primary index by the key \textit{\{1\}}, extract the secondary key
340+
\textit{\{2, 3\}}, delete it from the secondary index, and only then insert the
341+
new tuple. If the old tuple is not deleted, then during compaction it becames
342+
garbage with no link to a full tuple in the primary index.
343+
\begin{figure}
344+
\centering
345+
\includegraphics[width=0.3\textwidth]{inconsistent_example}
346+
\caption{LSM-tree based table inconsistency example}
347+
\label{fig:inconsistent_example}
348+
\end{figure}
349+
350+
Since disk access is much slower than memory access, secondary index presence
351+
destroys LSM-tree versions advantage. In the next section a new LSM-tree update
352+
algorithm is presented reviving versions and blind-writes.
353+
303354
\subsection{Math Equations}
304355
You may want to display math equations in three distinct styles:
305356
inline, numbered or non-numbered display. Each of

0 commit comments

Comments
 (0)