
mercial row store compares poorly, an optimized row
store can benefit from most of the same performance
techinques proposed for the C-Store system. Specifi-
cally, our optimized row store uses both careful page
packing, which we call “super tuples,” and sorting to
enable compression, which we call “column abstrac-
tion.” The remaining technique – column storage –
is the primary difference between row- and column-
oriented storage. Careful page packing is particularly
low-hanging fruit for a row store. Enforced sorting of
the relation and storing repeating values only once to
save space is slightly more effort, as it breaks the one-
to-one mapping of the logical relational schema to the
physical tuple on disk.
The main contributions of our paper are as follows:
• We provide descriptions of the “super tuple” and
“column abstraction” performance techniques to
optimize for a read-mostly query workload.
• We build a software artifact to evaluate these per-
formance improvements for both the row and col-
umn stores in isolation and in combination, us-
ing a common storage manager. Our experiments
vary tuple width, number of rows, level of sorting
and column abstraction, and number of columns
scanned to identify performance trends.
• We propose and validate a formal cost model for
sequential scan for both row and column stor-
age. The model takes into account the storage
improvements and their effects on performance
by identifying three factors which contribute to
overall scan time. We compare the mo del predic-
tions with our experimental results. We also use
the mo del to forecast the behavior of systems and
scenarios to gain further insight into performance
trends.
The rest of the paper proceeds as follows. In Sec-
tion 2, we present the storage optimizations and imple-
mentation details. Section 3 describes our experimen-
tal prototype and evaluates the storage optimizations
in isolation and combination to discover performance
trends. We then develop our formal cost model, with
validation and forecasting, in Section 4. We describe
related work in Section 5, and offer conclusions and
future directions for research in Section 6.
2 Storage Optimizations
In this section, we describe the “super tuple” and “col-
umn abstraction” optimizations for the row store ar-
chitecture. To illustrate the effects of each storage
option, we will use an instance of a materialized view
defined in the C-Store [7] paper. The view is based
on a simplified version of the schema from the TPC-H
benchmark [4], and is defined using SQL as follows:
L RETURNFLAG C NATIONKEY L EXTENDEDPRICE
A 3 23
A 3 34
A 9 64
N 3 88
N 14 49
R 9 16
R 9 53
R 9 7
R 11 63
R 21 72
R 21 72
Table 1: Example instance of materialized view
D4
CREATE VIEW D4 AS
SELECT L RETURNFLAG, C NATIONKEY, L EXTENDEDPRICE
FROM Customer, Orders, Lineitem
WHERE C CUSTID = O CUSTID
AND O ORDERID = L ORDERID
ORDER BY L RETURNFLAG, C NATIONKEY;
The definition is identical to the view called D4 in
the C-Store paper with the exception of the secondary
ORDER BY on the C NATIONKEY column. Table 1 contains
an instance of the D4 view that we use in all examples
for this section. Figure 1(a) shows how a standard row
store would layout the first few rows of the D4 view
on a disk page.
2.1 Super Tuples
All of the major DBMS products use a variant of the
slotted page for storage of tuples in a table. Slotted
pages use an array of slots that point to the actual
tuples within the page. Typically each tuple is pref-
aced by a header that provides metadata about the
tuple. For example, metadata in the Shore storage
manager [2] includes the type of tuple (small or large),
the size of the user-sp ec ified record header, and the
total size of the record if it is larger than one page and
split across disk pages. The tuple header is implemen-
tation specific, but typically is 8-16 bytes in addition
to the tuple’s slot entry.
While the slotted page design provides a generic
platform for a wide range of data storage needs, these
per-tuple overheads can be problematic. Even for an
80 byte tuple, a 16 byte overhead is 20%. We reduce
per-tuple overhead by packing many tuples into page-
sized “super tuples.” For fixed-length tuples, the super
tuple is an array of tuple-sized entries which can be
indexed directly. For variable length tuples, the tuple
length must be stored. The super tuple design uses a
nested iteration model, which ultimately reduces CPU
overhead and disk I/O.
An important side effect of using super tuples is that
external addressability of individual tuples is more dif-
ficult. Both the C-Store design and our optimized
row store trade the storage benefits derived from tight
packing of values for additional overhead associated
with utilizing and maintaining value indexes.
评论