Analytical Query Processing Beyond Main Memory
by Laurens Kuiper
The evolution of relational database management systems has been shaped significantly by advancements in computing hardware. Early database systems were designed around the hardware constraints of their time, optimising for limited memory, slow storage, and single-threaded execution. As hardware has advanced, offering large memory capacities, high-speed storage, and massive parallelism, database systems have adapted to utilise these resources. However, when queries require more space for temporary data than fits in main memory, the performance of database systems often disappoints. Due to large differences between modern in-memory query processing and traditional larger-than-memory (also referred to as external) query processing, execution times can increase by orders of magnitude when the memory limit is exceeded. This thesis aims to close this gap by designing query execution such that performance degrades gracefully, rather than abruptly, as the amount of temporary data exceeds the memory limit, but without sacrificing in-memory performance.
For the sort operator, we research how data orientation affects query performance. We build on prior work that showed that a row-oriented (as opposed to a column-oriented) data layout yields superior performance for grouped aggregation and joins. We demonstrate that the same holds for the sort operator. Then, we show that, with a minor modification that has a negligible impact on in-memory performance, the data stored in this row-oriented layout can be written to (and read from) storage without fully (de-)serialising it. Avoiding serialisation overhead is crucial for reducing the performance difference between in-memory and external query processing.
For the grouped aggregation operator, we research how to manage intermediate data. We identify shortcomings in traditional memory management and propose to use paged memory to store intermediates, and unify the memory management of temporary and persistent data. Then, we propose a buffer page layout for intermediates that builds on the previously proposed row-oriented data layout, improving it so that it can be written to storage without additional serialisation costs. We integrate the proposed techniques into the grouped aggregation operator and show that enables effortless larger-than-memory query processing.
For the join operator, we research how to manage the memory of query plans. Unlike the sort and grouped aggregation operators, the join operator has two inputs, only one of which is blocking; therefore, multiple operators can be active simultaneously. If multiple operators are active simultaneously, the memory of the entire query plan must be managed, as the combined memory usage of the active operators cannot exceed the limit. We first integrate the previously proposed techniques for managing intermediate data into the join operator. Then, we propose a technique to dynamically assign memory to active join operators that maximises data throughput. We show that the proposed techniques allow for efficient external join processing, even in query plans with many joins.
This thesis presents a significant contribution to external query processing that allows database systems to robustly process larger-than-memory intermediates without sacrificing in-memory performance. This greatly increases the volume of data that can be efficiently processed on typical hardware specifications.

At SIGIR 2016 in Pisa, Christopher Manning
