Website/slides/cse662fa2015/CSE66205-AdaptiveMerge/index.html

207 lines
7.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSE 662 - Database Languages &amp; Runtimes</title>
<meta name="description" content="Lecture Slides for UB's CSE662 - Database Languages and Runtimes">
<meta name="author" content="Oliver Kennedy">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="../reveal.js-3.1.0/css/reveal.css">
<link rel="stylesheet" href="../reveal.js-3.1.0/css/theme/simple.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="../reveal.js-3.1.0/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? '../reveal.js-3.1.0/css/print/pdf.css' : '../reveal.js-3.1.0/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="../reveal.js-3.1.0/lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h2>Adaptive Indexing</h2>
<h4>Adaptive Merge &amp; Generalized Cracking</h4>
<p><small>CSE 662 - September 15</small></p>
</section>
<!-- Cracking Recap -->
<section>
<h2>To Index or Not</h2>
<p><small>You've got an initially unsorted collection of records indexed by a key. You need to run range queries over it:</small></p>
<table>
<thead>
<tr><th>Scan Type</th><th>Prep Cost</th><th>Query Cost</th></tr>
</thead>
<tbody>
<tr><td>Linear Scan</td><td>None</td><td>Expensive</td></tr>
<tr><td>Index Scan</td><td>"Very" Expensive</td><td>Cheap</td></tr>
<tr class="fragment"><td>Cracker Scan</td><td>None</td><td>Decreasing</td></tr>
</tbody>
</table>
<p><b>Can we do better?</b></p>
</section>
<section>
<h2>Cracker Index</h2>
<ul>
<li>Partition on each range bound like quicksort</li>
<li>A full range query partitions twice</li>
<li>Save boundaries for future queries</li>
</ul>
<div id="cracking_hype_container" style="margin:auto;position:relative;width:200px;height:200px;overflow:hidden;" aria-live="polite">
<script type="text/javascript" charset="utf-8" src="Cracking.hyperesources/cracking_hype_generated_script.js?84337"></script>
</div>
</section>
<!-- Adaptive Merge Trees -->
<section>
<section>
<h2>Adaptive Indexing</h2>
<p><b>How else</b> can we re-use query work?</p>
</section>
<section>
<h2>Adaptive Merge Trees</h2>
<ul>
<li><b>Observation 1:</b> Sorting a list is $O(N \cdot \log(N))$</li>
<li><b>Observation 2:</b> Sorting $k$ partitions is $O(N \cdot \log(\frac{N}{k}))$</li>
</ul>
<p><small>Pick $k$ so that $\frac{N}{k}$ is a constant, and your startup work is linear!</small></p>
</section>
<section>
<h2>Adaptive Merge Trees</h2>
<div id="amerge_hype_container" style="margin:auto;position:relative;width:600px;height:400px;overflow:hidden;" aria-live="polite">
<script type="text/javascript" charset="utf-8" src="AMerge.hyperesources/amerge_hype_generated_script.js?29989"></script>
</div>
<p><small>A little more upfront work, faster responses</small></p>
</section>
<section>
<h2>Adaptive Merge Trees</h2>
<img src="graphics/AMerge-Performance.png" height=400 style="border: none;"/>
<p><small>Much faster congergence!</small></p>
</section>
<section>
<h2>In Practice...</h2>
<ul>
<li class="fragment">A factor of $O(\log(N))$ improvement is not huge</li>
<li class="fragment">"Merging" requires a huge amount of bookkeeping</li>
<li class="fragment"><b>but...</b> that fast convergence is nice!</li>
</ul>
<div class="fragment"><b>Why do we get fast convergence?</b></div>
</section>
</section>
<!-- Generalized Cracking -->
<section>
<section>
<h2>Mixing Cracking and Merging</h2>
<ol>
<li>Start with partitioned data</li>
<li>Extract goal data from each partition independently<ul>
<li class="fragment">Crack each partition independently</li>
<li class="fragment">Sort each partition independently then merge</li>
<li class="fragment">Radix "sort" each partition then crack</li>
</ul></li>
<li>Merge cracked regions</li>
<li>Postprocess merged data<ul>
<li class="fragment">"Crack" the merged data if needed</li>
<li class="fragment">Sort the merged data</li>
<li class="fragment">Radix partition the merged data</li>
</ul></li>
</ol>
</section>
<section>
<h2>Crack + Crack</h2>
<img src="graphics/Hybrid-CrackCrack.png" height=500 style="border: none;"/>
</section>
<section>
<h2>Crack+Crack vs Radix+Radix</h2>
<img src="graphics/Hybrid-Cmp-CrackCrack.png" height=250 style="border: none;"/>
<img src="graphics/Hybrid-Cmp-RadixRadix.png" height=250 style="border: none;"/>
</section>
<section>
<h2>Hybrid Algorithms</h2>
<img src="graphics/Hybrid-Table.png" height=500 style="border: none;"/>
</section>
</section>
</div></div>
<script src="../reveal.js-3.1.0/lib/js/head.min.js"></script>
<script src="../reveal.js-3.1.0/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/../reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'fade', // none/fade/slide/convex/concave/zoom
// Optional ../reveal.js plugins
dependencies: [
{ src: '../reveal.js-3.1.0/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: '../reveal.js-3.1.0/plugin/math/math.js', condition: function() { return true; } },
{ src: '../reveal.js-3.1.0/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: '../reveal.js-3.1.0/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: '../reveal.js-3.1.0/plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: '../reveal.js-3.1.0/plugin/zoom-js/zoom.js', async: true },
{ src: '../reveal.js-3.1.0/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>