---
title: "TPC-H Analyzed — paper by Boncz et al. (2014)"
description: "TPC-H Analyzed explains which database operations make the benchmark difficult and how its queries reward better execution and optimization."
canonical: "https://research.elamur.ai/free/en/papers/boncz-2014-tpc-h-analyzed-hidden-messages/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/boncz-2014-tpc-h-analyzed-hidden-messages/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2014](https://md.research.elamur.ai/free/en/papers/2014/) / TPC-H Analyzed: Hidden Messages and Lessons Learned from an Influential Benchmark

# TPC-H Analyzed: Hidden Messages and Lessons Learned from an Influential Benchmark

Paper · 2014 · Peter A. Boncz, Thomas Neumann and Orri Erling

**Authors:** Peter A. Boncz, [Thomas Neumann](https://md.research.elamur.ai/free/en/authors/thomas-neumann/) and Orri Erling · **Year:** 2014 · **Venue:** Lecture notes in computer science · **Licence:** No open licence stated (free-to-read copy; rights reserved) — text kept private

[Cited by **7** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/boncz-2014-tpc-h-analyzed-hidden-messages/cited-by/) · Lecture notes in computer science

- [PDF](https://ir.cwi.nl/pub/21424/21424B.pdf)
- [DOI 10.1007/978-3-319-04936-6_5](https://doi.org/10.1007/978-3-319-04936-6_5)

## Summary

A database benchmark can tell you how quickly a system finished a workload. It takes a closer look to tell you what the system had to do well to finish it. In *TPC-H Analyzed*, Peter Boncz, Thomas Neumann and Orri Erling take that closer look at TPC-H, a benchmark for analytical relational databases. They examine the queries, the organization of the generated data and the rules for running the workload. Their aim is to explain why particular queries reward particular technical capabilities. They call these challenges *choke points* because solving one can make an important part of the workload run substantially better.

The authors identify 28 choke points across six areas. These cover aggregation, joins, data access locality, expression evaluation, correlated subqueries and parallel execution. The opportunities often arise from interactions. A join that preserves the order of its input can make the following aggregation cheaper. A restriction on order dates can narrow the search for line items because the data generator relates the dates in the two tables. A filter that rules out most potential join matches can save hash table lookups and, in a distributed system, reduce the amount of data sent between machines. A benchmark query may therefore reward how well an optimizer connects successive operations as much as how quickly the execution engine runs any individual operation.

The paper illustrates these mechanisms with examples from existing systems. In VectorWise, adding a Bloom filter to a join that rarely found a match made the PARTSUPP–PART join in Q2 six times faster and accelerated Q2 two-fold overall. In HyPer, combining subquery decorrelation, selective join pushdown and reuse yielded a factor 500 speedup for Q17. The first example distinguishes the effect on an operator from its effect on the whole query. The second gives the joint effect of several techniques. The paper uses such cases to explain the workload rather than to produce a new ranking of database products.

The authors also ask what makes a benchmark worth designing in the first place. TPC-H gives database developers a reason to improve capabilities that matter beyond the workload, from recognizing useful orderings to allocating resources across concurrent queries. Its rules and data also shape which capabilities the scores reflect. The ban on materialized views keeps attention on answering queries at runtime, while repeated parameter bindings in highly concurrent runs can reward result reuse. The authors argue that a benchmark can serve as both a comparison of systems and an incentive to tackle worthwhile engineering problems. The range of problems embedded in TPC-H is what they want future benchmark designers to learn from. [Evaluation & benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/)

## Deep dive: TPC-H Analyzed: Hidden Messages and Lessons Learned from an Influential Benchmark

TPC-H Analyzed explains which database operations make the benchmark difficult and how its queries reward better execution and optimization. · about 37 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What a finished workload can tell you

An analytical query can spend its time in several places. It may scan a large table to find the relevant rows, connect those rows to records from other tables, calculate expressions on the resulting data or keep track of groups for a summary. In a concurrent workload, it may also wait for memory, processor time or access to storage. A benchmark score reflects the combined effects of those costs. To understand how an engine could improve, a developer needs to relate the workload to the operations and resource decisions that produced the score.

TPC-H gives the authors a concrete workload in which to make those connections. Its tables represent orders, individual line items, customers, suppliers and other records used in decision support. Joining an order to its line items is a recognizable operation, as is grouping the resulting records to calculate totals. The technical difficulty depends on details that the business description leaves implicit. It matters how many orders survive a date restriction, whether the line items can be found near one another in storage and whether the join leaves its output grouped in a useful way. These details are where the authors locate the benchmark's demands on an implementation.

The paper treats the choice of workload as part of benchmark design. A recognizable business scenario helps practitioners understand what is being measured. Representative tables and queries also give them a reason to expect the measurement to matter beyond the test. The authors point out a separate design goal. Benchmarks can create an incentive to solve problems that current systems handle poorly. A set of production query logs can reflect the work people already find practical to run. A benchmark designer can go further by choosing tasks that expose costly operations and give implementers a reason to improve them.

The authors describe this distinction through their work on the Linked Data Benchmark Council. They describe practitioners contributing data and workload requirements, with specialists from industry and academic research helping identify technical challenges to embed in the tests. TPC-H provides a retrospective example of what such challenges look like once a workload is well understood. Its value for that discussion is the variety of capabilities it exercises, including capabilities that sit at the boundary between query optimization, execution and storage.

#### How the benchmark came to emphasize runtime execution

The paper traces TPC-H back to TPC-D, which it dates to 1995. Its account of materialized views explains why the history matters to interpretation. A materialized view stores the result of a query or intermediate computation. A later request can use that saved data to avoid repeating the work that produced it. In a warehouse, this can be a valuable way to answer recurring questions. For a benchmark intended to exercise ad hoc query processing, a small precomputed structure that contains much of what the benchmark will ask for can shift the test towards looking up answers.

The paper describes a period when the ability to use such structures became prominent in comparisons between database products. Even with different parameters across runs, the recurring query shapes admitted compact materialized views that effectively contained parameterized answers. TPC-D eventually split into TPC-R, which allowed materialized views and was later retired, and TPC-H, whose rules excluded them. That choice determines where a system has to earn its performance. Access paths, join plans, expression evaluation and other runtime decisions all remain consequential when the requisite aggregates and join results have to be produced during the test.

The benchmark's treatment of storage layout also changed. The original TPC-D rules excluded vertical partitioning, which separates a table by columns. TPC-H later admitted systems that apply column-oriented storage uniformly. In these systems, a query can read the columns it needs without retrieving the full contents of each row. The paper presents this as a broad design choice that helps analytical workloads without requiring a database administrator to prepare a saved answer for each question.

The authors acknowledge that TPC-DS could be regarded as having superseded TPC-H. Their analysis asks what engineering problems the older benchmark contains and why a workload with that range of demands is useful to study. In earlier database research, the techniques relevant to those problems were typically discussed in terms of their own operators or access methods. The paper brings examples together around the queries that would benefit from them. Existing work discussed by the authors includes keeping track of useful row orders, enumerating plans with restrictive join types, detecting dependencies in stored data and turning correlated subqueries into joins. The workload gives those techniques a common setting in which their interactions are visible.

### The method, step by step

#### Reading a query as a sequence of physical decisions

The paper's method is a technical examination of an existing benchmark. The authors start with the operations expressed by the queries and ask how a database could produce the requested answers. The logical description says which records and values are required. A physical plan specifies how to find those records, when to combine them, how to maintain intermediate state and where the work will run. Multiple physical plans can produce the same answer while placing very different demands on memory, processors, disks and the network.

Their analysis follows the data as it moves through a plan. At a scan, the question is which columns and physical ranges the engine must read. At a join, the questions include how many matches to expect, what data will have to move and whether the output retains a useful ordering. At an aggregation, the amount of state depends on how many groups the engine encounters and whether matching rows arrive together. The authors also look beyond an individual plan. They consider the generated data, the permitted physical designs, the effects of refresh operations and the interaction between queries running at the same time.

The resulting classification maps queries to choke points and assigns qualitative impact levels. Its entries locate opportunities in query optimization, execution or storage. A problem can cross those boundaries. For instance, a column layout creates the opportunity to postpone reading a field, an optimizer must recognize when that will reduce work, and the execution engine must fetch the field efficiently when it is finally needed. The workflow consists of reasoning through such cases in the fixed workload. It has no training stage or separation into training and test queries.

How the authors identify choke points in TPC-H The steps in order.

#### Aggregation depends on which rows arrive together

A grouped aggregation maintains a running result for each distinct grouping key. If a query totals sales by customer, the engine needs to recognize the customer associated with each incoming row and add the row's contribution to that customer's state. A hash table is a common way to locate that state. It turns the key into a lookup position and can provide constant lookup cost when appropriately sized. The cost in practice changes as the number of distinct keys grows. A table that exceeds the processor's caches can make each lookup more expensive. A table that exceeds main memory may require the engine to write partitions of the incoming data to temporary files and aggregate each partition separately.

The authors consider sorting and B-tree-based aggregation as alternative ways to handle large collections of groups. They also distinguish the case in which group members are already adjacent in the input. An engine can finish a group's state when it reaches the next group and then move on. Global numerical or alphabetical order is sufficient for this approach, but adjacency of equal keys is the operative condition. Hybrid plans can exploit partial grouping or use hashing to reduce data before an external sort. Selecting among these approaches requires estimates of how many groups an expression will produce and an understanding of what fits in the relevant memory.

Useful ordering can carry over from an earlier operator. The paper calls these *interesting orders* because keeping track of them can change the cost of the rest of a plan. In Q3, Q4 and Q18, the join between ORDERS and LINEITEM is followed by a grouping involving the order key. A hash join builds a lookup table on one input and probes it with rows from the other. If ORDERS is the probe input and the implementation preserves its order, the rows associated with each order can arrive together at the aggregation. A planner comparing join choices can credit the preserved order for saving work in the next operator. The authors identify a comparable opportunity involving suppliers in Q21.

For Q1, the authors identify a different way to avoid general-purpose hashing. The query calculates eight aggregates and groups by the return flag and line status. The data contain four combinations of those attributes. When a small range of integer codes can represent the keys, the engine can address group state directly in an array. Single-character strings such as the grouping attributes in Q1 can be given integer representations. If several attributes make up the key, the combined representation still has to be compact enough for direct addressing. The advantage comes from the bounded space of possible keys, which determines the number of array positions the engine would reserve.

A grouping key can also contain attributes whose values are determined by another key. In Q10, the customer key identifies the customer record. Fields such as name, address and phone therefore add no distinction between groups once the engine has established the customer identity. The paper uses a dependency arrow to express this relationship. A compact example from its analysis is the ordering information attached to an order in Q3.

```
#o → o_shippriority, o_orderdate
```

Here `#` denotes tuple identity and `o` refers to an ORDERS row, so `#o` is the identity of that row. The arrow `→` means that the value on the left determines the values on the right. `o_shippriority` and `o_orderdate` are the order's shipping priority and date, and the comma lists both dependent attributes. The engine can use that dependency to shorten what it compares when finding a group while retaining the information needed in the output.

Declared keys give the optimizer evidence for such dependencies. They can also simplify a join where each row on the many side has exactly one matching row on the referenced side. A hash lookup can stop at that match, and the operator can plan its output knowing the join will add a single partner to the intermediate record. The paper notes that TPC-H permits systems to leave keys undeclared. It describes EXASOL using foreign-key checks during loading and suggests that these checks might also reveal the constraints. The inference about what the system learns from the checks is presented as a possibility.

#### Join cost depends on the size and shape of the matches

A join links rows according to a condition, such as an order key shared by an order and its line items. A hash join can build a table of keys for one input and look up each key from the other. An index-based join can use an existing index to locate matching rows. When the join key is a prefix of the index key, the index offers a direct access path. The cost of using it can depend on whether records are clustered in index order and whether the relevant data are already in memory. A lookup that involves poorly localized storage accesses carries a different cost from a lookup into a memory-resident working set.

Q9 illustrates why the authors examine locality separately for each edge of a join plan. The query connects LINEITEM to ORDERS and also to PARTSUPP, with further joins to PART and SUPPLIER. The restriction on PART selects 1 in 17. If ORDERS and LINEITEM are organized in a compatible way, their join can process matching ranges or partitions together. That layout can still leave the join from LINEITEM to PARTSUPP with widely dispersed accesses. Once the working set exceeds main memory, the engine may have to write and reread intermediate partitions. On a cluster, rows or keys can have to cross the network to reach their matching records.

Replicating PARTSUPP, PART and SUPPLIER across the cluster is one way to put those records close to the workers that need them. The paper treats this as a physical design tradeoff. Replicas consume memory and storage, while the TPC-H refresh operations leave these particular tables alone. The absence of refresh changes to those replicas removes a source of maintenance cost in this benchmark. In another part of the workload, the relevant opportunity is an operator that combines stages. For Q13, the authors point to GroupJoin, which combines an outer join and aggregation so the plan can avoid building equivalent hash state for both.

Many other joins have a different shape. A filter on the referenced table can remove most of the possible matches before the join runs. The authors describe hit ratios below 1 in 10 as typical in TPC-H, with some joins lower still. The join therefore spends much of its time looking for rows that are absent from its build input. A Bloom filter is a compact membership test that can rule out a key before the engine undertakes a full lookup. Keys that pass the test remain candidates for the join, which verifies their actual matches.

The point at which the filter is applied matters. Testing immediately before a hash lookup saves lookup work. Moving the test into the probe-side scan can save work earlier, while the engine still has the opportunity to avoid decompressing other columns or to skip a block if no rows in it need to proceed. In a distributed join, the workers can exchange filters ahead of the probe keys. Each worker can then avoid sending keys that cannot match at the destination. The same logical decision can thus affect processor work, storage access and network traffic.

The optimizer also needs to choose the sequence in which the tables meet. The paper reports that some TPC-H queries join up to eight tables whose cardinalities, or row counts, differ widely. Joining a heavily filtered input early can keep intermediate results small. The space of valid orders depends on the operators. A semi-join retains rows from one side that have a match, an anti-join retains those that lack a match, and an outer join can retain unmatched rows. Their semantics constrain how a planner can rearrange them. The authors discuss dynamic programming as a way to enumerate alternatives and cite earlier work on handling these restrictions, including a representation in which a predicate can connect more than a pair of tables.

Late projection poses another choice about the shape of intermediate work. A column store can carry row identifiers through a plan and retrieve a column when it is actually needed. In Q5 and Q10, the paper sees opportunities to fetch fields after the working set has been reduced. A final limiting operation or an aggregation with few output groups can make those late fetches inexpensive overall. They can nonetheless be scattered because an intervening operation may change row order. The point of comparison is the cost of reading many values sequentially at the beginning versus reading the surviving values where they happen to lie later in the plan. Sparse joins offer a related opportunity: read the probe keys first and defer other columns until a match is established.

#### The data generator provides clues about where to look

Column stores exploit the fact that an analytical query usually references a subset of a table's fields. This matters throughout TPC-H because the workload contains no request to retrieve every field of a table. The gain depends on the volume of the omitted columns. The authors report that, in VectorWise, approximately half of the TPC-H data volume was concentrated in the comment columns of ORDERS and LINEITEM. A query that can avoid those fields may save much more input than a simple count of its unused columns suggests. Compression provides a further reason to lay out similar values together.

The locality of rows is equally important. TPC-H's generator connects order dates to shipping, commitment and receipt dates. The paper gives the relationships as offsets within specified ranges.

```
l_shipdate = o_orderdate + random[1:121]
```

`l_shipdate` is the line item's shipping date, and `o_orderdate` is the corresponding order's date. The equals sign `=` gives the rule for the generated value, and `+` adds an offset in days. `random[1:121]` denotes an offset drawn from the range with endpoints `1` and `121`, with the brackets enclosing the range and `:` dividing its lower and upper endpoints.

```
l_commitdate = o_orderdate + random[30:90]
```

`l_commitdate` is the line item's commitment date, and `o_orderdate` again supplies the order date. The signs `=` and `+` assign the date by adding an offset. In `random[30:90]`, the brackets enclose the allowed offset range in days, and the colon separates its bounds, `30` and `90`.

```
l_receiptdate = l_shipdate + random[1:30]
```

`l_receiptdate` is the receipt date and `l_shipdate` is the shipping date of the line item. Here `=` assigns the generated receipt date and `+` adds the offset in days. The notation `random[1:30]` denotes a draw from the bracketed range whose lower and upper endpoints, separated by `:`, are `1` and `30`.

In Q3, a lower bound on shipping date and an upper bound on order date can together provide a range for the order date. The paper represents that candidate range as follows.

```
[LO−121:HI]
```

`LO` is the lower bound imposed on the shipping date, and `HI` is the upper bound imposed on the order date. The minus sign `−` subtracts `121` days from `LO`, using the maximum shipping offset given by the generator. The brackets enclose the resulting range on the order date, and `:` separates its lower and upper endpoints. The range gives the engine a way to exclude records that cannot contribute, with the query predicates still establishing the precise answer.

To take advantage of this, the engine needs a physical layout or metadata that can translate a narrowed date range into less work. A clustered index can keep rows in date order. A scan can then visit the relevant area, and a join that follows order keys can still have good locality if the dates on both sides move together. The column selected as the clustering key and the column mentioned by the query can be different. A system that detects the correlation may nonetheless derive a usable restriction for the stored order of the data.

Range partitioning offers another way to make the restriction physical. If a partition covers a range that cannot satisfy the predicate, the engine can skip it. When tables are partitioned compatibly for a join, the engine can also avoid combining partitions whose join cannot yield rows. The authors describe a possible bitmap for this purpose. For each partition, it would identify partitions on the other side with which the join has no result. The paper suggests maintaining this information alongside foreign-key checks. It is a proposed mechanism for exploiting the relationship between partitions.

There are also ways to learn enough about locality without relying on the optimizer knowing the generator's rules. The paper discusses statistics over several attributes and metadata that record minimum and maximum values for regions of a table. These bounds can be conservative. A region can be skipped when even its broader bounds exclude the values sought. If a table is clustered by receipt date, ranges of shipping dates may still correspond to compact ranges of row positions. Minimum and maximum metadata can expose this relationship to a scan even when the condition names the column that was not used to cluster the table.

#### Expression cost adds up across a large scan

Q1 illustrates what happens when much of a query's work consists of doing arithmetic repeatedly. It selects 99% of LINEITEM, calculates prices and related quantities, and maintains several aggregates. A small saving in each expression can matter across that many rows. The authors consider the representation of decimals, the cost of checking arithmetic for overflow, the ability to work on compressed values and the overhead of interpreting the expression for each tuple.

The decimal range specified for TPC-H is `[-9,999,999,999.99: 9,999,999,999.99]`, with increments of `0.01`. The paper describes representing such values as scaled integers.

```
stored integer = decimal value × 100
```

`stored integer` is the value the engine keeps in the integer representation, and `decimal value` is the represented amount. The sign `=` gives the encoding rule, while `×` multiplies the amount by the scale factor `100`. The paper gives `42-bits` as the precision needed for the specified range. A `64-bits` integer can hold that range, while a `32-bits` integer is too narrow for the full decimal type.

Values in particular columns can occupy much smaller ranges than the type permits. The paper gives `[0.00:100000.00]` for `l_extendedprice`, `[1.00:50.00]` for `l_quantity`, `[0.00:0.10]` for `l_discount` and `[0.00:0.08]` for `l_tax`. It associates these ranges with byte-aligned integer widths of `32`, `16`, `8` and `8` bits, respectively, during expression evaluation. The smaller widths allow one machine instruction to handle more rows at once. This is the idea behind SIMD, which applies an instruction to several data values held together.

The authors use a discounted price to show where an expression changes width.

```
l_extendedprice × (1 − l_discount)
```

`l_extendedprice` is the line item's extended price and `l_discount` is its discount. The constant `1` represents the full price fraction before the discount. The minus sign `−` forms the remaining fraction, and the parentheses make that subtraction an input to the multiplication `×`. The paper describes calculating the subtraction on narrow values and widening its result for multiplication with the price. It also uses this example to discuss range-based overflow checking. If dependable bounds for the operands establish that an intermediate result fits in the selected type, the engine can omit the per-row check for that operation. The particular interval written for the discount factor in the paper requires care, as discussed under limitations.

Shared expressions can further reduce the arithmetic. In Q1, the same intermediate calculation can feed several reported values. The optimizer can recognize equivalent expression fragments and arrange to evaluate a fragment once. The paper also points out that some averages can be formed at the end from aggregates the engine has already accumulated.

```
average = SUM ÷ COUNT
```

`average` is the derived aggregate, `SUM` is the total for the values being averaged, and `COUNT` is the corresponding count. The equals sign `=` defines the calculation and `÷` divides the total by that count. The opportunity applies where the accumulated sum and count refer to the right values for the requested average. It moves a calculation to the point at which the group totals are already available.

Compression can change what an expression has to operate on. With dictionary compression, a stored integer identifies a string in a dictionary. A suitable comparison to a constant can use the identifier directly, avoiding expansion of all the input strings. The paper discusses arithmetic over run-length-encoded data as an established example of compressed execution, then explains why it sees little scope for that example in TPC-H. Its stronger opportunity in this workload is comparison of columns with constants. It also describes several ways systems reduce expression dispatch overhead, including handling tuples in batches and compiling query expressions for execution.

#### Boolean and string predicates reward work done at the right point

A condition involving values from both sides of a join generally needs both inputs before the engine can decide whether a joined row satisfies it. The optimizer can still derive restrictions that each side must satisfy independently. In Q7, the query connects the nations associated with customers and suppliers, and accepts the specified pair in either direction. The paper's condition can be written in terms of the customer and supplier nation names.

```
(S = NATION1 AND C = NATION2) OR (S = NATION2 AND C = NATION1)
```

`S` is the supplier's nation name and `C` is the customer's nation name. `NATION1` and `NATION2` are the two nation parameters appearing in Q7. The sign `=` tests equality. `AND` requires both equalities in its parenthesized case to hold, and `OR` allows either case. The parentheses define which equalities belong to each direction of the pairing.

```
C = NATION1 OR C = NATION2
```

`C`, `NATION1` and `NATION2` have the same meanings as in the join condition. The equals signs test the customer nation against the two parameter values, and `OR` accepts either equality. The engine can apply this derived condition when it reads customer nations. A corresponding condition can restrict supplier nations. The original condition still governs which pairings survive once the join brings the names together.

The paper also describes assigning small indicator values during the nation scan. Later operations can test those values instead of repeatedly comparing names. The gain depends on how the engine already represents and compares the strings. Dictionary-compressed execution can offer a similar advantage when the column and predicates support it. An `IN` condition creates a related implementation decision. A short list of constants can be tested with successive comparisons. With a larger list, the engine can build a hash table of acceptable values and check membership much like a semi-join. The paper reports lists of at most eight constants in the TPC-H examples it discusses and describes larger lists as a concern for analytical query generators in practice.

For conjunctions and disjunctions, the order of testing can matter. If an inexpensive condition rejects many rows, testing it early in a conjunction can save evaluation of later conditions. The strongest early filter may change across the scan. In the paper's example, rows are stored in shipping-date order and a restriction refers to receipt date. The fraction of rows passing that restriction can rise and fall as the scan moves through the table. An execution engine that observes the pass rate can revise its evaluation order during the query, subject to preserving the query's behavior.

Finally, `LIKE` patterns can be expensive when a general interpreter examines each string. A constant prefix gives the optimizer a way to identify a narrower range of possible matches ahead of the full check. The paper illustrates the idea with a prefix beginning at `xxx` and a candidate range bounded by `xxx` and `xxy`. More complex constant patterns can be compiled into a finite-state automaton, which moves through recognition states as it reads the string. Another strategy splits a pattern into simpler searches and returns to earlier matching choices when a later part fails. The authors also distinguish long comparisons that are suitable for processing bytes in batches from short comparisons that often end at the first mismatch. The type of operator helps determine which case is common.

#### Correlated subqueries can be reorganized as shared work

A correlated subquery uses a value from the surrounding query. A request for the lowest supplier cost for the current part, for example, gives the inner query a part key from the outer query. An implementation that runs the inner query separately for each outer row can repeat substantial work. *Decorrelation* transforms the dependency into a plan that relates sets of rows with joins. In Q21 the authors point to existence and nonexistence tests that can be represented with an equality join plan and an anti-join plan. Set-oriented operators give the engine choices about how to find the matching and missing records.

The paper also describes batching keys when dependent lookups remain in an execution plan. An index interface that accepts many lookup keys in a call can exploit locality among them. This offers a way to reduce the cost when the engine executes blocks of rows. The relevant property is that requests arrive together, giving the access method a chance to organize work across them.

Decorrelation is only part of the opportunity in some queries. Q2 asks for the minimum supplier cost for a part while the outer query applies restrictions on part type and size. Carrying those restrictions into the inner computation can limit the parts for which the minimum is calculated. The authors see related opportunities in Q17 and Q20. The optimizer has to recognize which restrictions can be moved while preserving the answer. It can then use the closer placement to reduce the inputs to the expensive operation.

The outer and inner parts can also contain the same joins and selections. The authors identify this pattern in Q2, Q11, Q15, Q17 and Q20. An execution plan drawn as a tree gives each intermediate result its own parent. Sharing calls for a directed acyclic graph, in which a producer can supply more than one consumer. The underlying join and selection work can then be executed once and its result made available to both parts. The optimizer needs to detect the common computation, and the engine needs to retain or distribute the intermediate output so both consumers can use it. These are separate requirements for obtaining the benefit.

#### Parallel plans and concurrent streams compete for resources

The Power test presents the benchmark's queries sequentially. A system can devote its resources to the active query and divide that query's operations across workers. The work in Q1 is particularly amenable to this treatment. Workers can handle separate portions of the input and produce small partial aggregate results that can be combined. A join between large tables can be more demanding. Workers may need to coordinate their processing or move rows so that matching inputs are available together.

The Throughput test runs several query streams concurrently with different parameter choices. Workload management now has to account for memory, cores and input/output resources claimed by queries that are at different stages. A decision that is reasonable for a single newly arrived query can become expensive when others arrive and also need memory or access to storage. Giving fewer workers to a query can be a good system-wide decision when enough other queries are ready to execute. Conversely, dividing the work within a query matters when there are too few active streams to use the available processors.

Distributed execution adds placement to the decision. The system chooses which machines should take part and what they should do. Compatible partitioning of ORDERS and LINEITEM can keep much of their join local to each worker. Additional joins may involve tables partitioned in another way. Even a network built for high throughput can become a bottleneck if the plan needs to redistribute enough data. The authors use this dependency on physical placement when assigning difficulties in their classification.

The design of the workload's parameter generator creates a final opportunity. Some parameter domains are small, so enough concurrent streams can produce identical requests. A cache of final answers can serve repeated queries, and a mechanism that retains useful intermediate results can find shared work even where complete answers differ. The authors describe earlier work that evaluates such intermediates using their size, the cost of producing them and how frequently they arise. Their reading of the TPC-H rules is that admissible caching should be part of the system's ordinary behavior, so a system can benefit from broadly applicable reuse without an explicit configuration aimed at these particular requests.

### Experiments and results

#### What the workload measures

The data are those of the existing TPC-H benchmark, with the generator's relationships between business records and dates. The paper analyzes the 22 query templates, using their parameterized runs and the benchmark's refresh operations to explain different sources of work. The Power workload includes the 22 queries and two refresh queries. The refresh operations insert and delete data from ORDERS and LINEITEM, with deletion ranges scattered through the order-key space. Throughput uses concurrent query streams with different parameter choices. The paper says implementers can choose whether the refresh streams run in parallel with the query streams in that test.

The Power score uses a geometric mean. The authors emphasize what this means for interpretation: a given relative change carries the same weight for a fast query as for a slow one. That weighting gives an implementer a reason to improve short queries as well as long ones. The Throughput score is derived from the time span needed to finish the streams, so work that lengthens the concurrent run affects the result through its contribution to elapsed time. The paper discusses the scheduling implications using `5 (100GB)` and `7 (1TB)` as examples of concurrent query-set counts and benchmark scales.

The analysis has no common experimental baseline across database products. Its primary result is the classification of 28 challenges into six groups, with a qualitative map of which queries encounter each challenge and how strongly. The quantitative cases in the paper compare particular operations, implementation settings or plan choices. Some report changes observed in a named engine. Others characterize input volumes, selectivity, or what an instruction can do given a specific representation. These figures answer different questions and have to be read at the scope at which the paper gives them.

#### Effects on operators and complete queries

In VectorWise, a hash join can create a Bloom filter during execution when it notices a low rate of successful probes. The paper's case is the join between PARTSUPP and PART in Q2. The filter made the join six times faster, with Q2 accelerating two-fold overall. The baseline for the example is execution without that filtering improvement. The report gives both levels of measurement, so the effect on the join can be distinguished from the effect on the full query. Other work in Q2 remains part of the full query time.

For Q19, the paper reports a 20% performance improvement in VectorWise when the Boolean expression operator adapted to the selectivities it was observing. The relevant change is the operator's ability to swap the order of conjunction tests during execution when the other ordering repeatedly appears more selective. The example addresses performance at the query level. The paper describes how complementary rewrites can bring disjunctions into a form that takes advantage of the same mechanism.

The HyPer example is Q17. The paper attributes a speedup of a factor 500 to the combination of decorrelation, selective join pushdown and reuse. These mechanisms change the plan in different ways. Decorrelation replaces dependent execution with a join-based plan, selective pushdown shrinks the work done on the relevant inputs, and reuse prevents a computation from being repeated. The stated speedup compares the combined treatment with execution before those techniques are applied in the example. The paper gives no separate timing for each part of the combination.

The figure below shows a different sort of comparison. It expresses the arithmetic capacity described for the Q1 discounted-price calculation, measured in tuples handled per SIMD instruction. The narrow subtraction and the widened multiplication occur at different stages of the same expression. The comparison shows the reason for keeping the discount calculation narrow until the operands have to match the representation of the price. It concerns work per instruction at those stages, with overall query runtime depending on scans, aggregation and the rest of the plan as well.

TPC-H Q1 discounted-price arithmetic by operation and SIMD capacity The narrow subtraction handles more tuples per instruction than the widened multiplication.

**The numbers**

| System or setting | tuples per 256-bit AVX instruction |
| --- | --- |
| Discount subtraction on 8-bit values (this paper) | 32 |
| Price multiplication after widening to 32-bit values | 8 |

The authors give another instruction-level example for string processing. They report that SSE4.2 primitives on a Nehalem core can process 16 bytes in 4 cycles and describe this as 20 times faster than a normal `strcmp` for the comparison under discussion. The benefit they describe is for work that can use a batched comparison over enough bytes. An engine that usually discovers inequality immediately can end the comparison by inspecting only the initial bytes. The authors use that contrast in input behavior to explain why a different implementation may be appropriate for a selection predicate than for matching keys during grouping.

#### How workload quantities explain the opportunities

The paper gives several quantities that describe how much work could be avoided before a particular system is timed. In Q7, the derived early filter on the customer nation reduces the data volume at the relevant step by a factor 12.5. The quantity belongs to the candidate data for the join. The whole query still connects customers to orders, line items and suppliers and applies the complete condition on the nation pairing. The case isolates a logical reduction an optimizer can seek before paying for those later operations.

For access locality, the authors report that the date selections for Q3, Q4, Q5, Q8, Q10 and Q12 cover respectively `2,3,12,12,3,12` out of `72` months. They describe a selection fraction of `1 in 6` to `1 in 36` on ORDERS that can usually be carried over to LINEITEM. Q12 demonstrates propagation in the opposite direction to an order-date filter originating on ORDERS. Its range starts on receipt date in LINEITEM and can constrain ORDERS. The practical saving depends on whether the physical organization and optimizer allow the information to eliminate scans or improve the locality of the join.

At the workload level, the authors report that identical queries become significant beyond 20 streams, and give the region name as an example of a parameter with at most 5 possible values. This observation explains why reuse can affect a concurrent run. It does not provide a numerical cache hit rate or a speedup for a caching implementation. At the level of historical benchmark results, the paper reports that columnar products held the top scores on cluster and single-server platforms in `2010-2013`. Those standings are observations about complete systems, whose scores include the combined effects of storage, execution, optimization and configuration.

### What the ablations show

The paper contains no formal ablation series. It offers comparisons between implementation choices, examples of reported changes in named systems and analyses of cases in which the query or data layout makes a technique promising. Some of those comparisons isolate a decision closely enough to explain its effect. Others show why several choices need to be considered together. The distinction matters when using the examples to judge where a system would gain from a change.

#### A benefit can appear in a later operator

The discussion of ordered aggregation compares what the engine can do with consecutive group members and what it must do with an input that mixes groups. In the former case, the engine can finish a group's result when the key changes. In the latter, it needs a way to store and retrieve the partial states of groups that will recur. The contrast explains why a join that preserves a useful order can improve an aggregation even if the join's own cost is similar to another option. A whole-plan comparison can recognize that relationship.

Q1 and Q10 make the same point about retained state from different directions. In Q1, a compact key domain gives the execution engine a cheap way to address state. In Q10, dependency information shortens what the engine has to use to identify the state. The relevant facts are the key values that can arise and which of the named fields distinguish the result groups. Judging the opportunity from the length of the `GROUP BY` list alone would miss the role of both.

The paper's late-projection cases make the timing of data access explicit. Carrying a column through a long section of a plan can involve reading and processing values for rows that are later discarded. Retrieving it at the end concentrates the work on rows that survive. The authors also account for the locality lost when a late fetch follows row identifiers in scattered order. The benefit depends on how far the plan has reduced the data by then. A column used late is a candidate for this comparison, with the size and order of the late input determining the tradeoff.

#### The source of the saving determines how widely it transfers

Q2 supplies the paper's clearest example of distinguishing operator and query performance. The low join hit rate is what makes an early membership test attractive. Its effect on the full query depends on how much of that query's time was spent making unsuccessful probes. Pushing the test down into a scan adds possible savings in decompression and access to blocks. Exchanging the filter before a distributed join adds a possible saving in communication. Each extension follows from where the engine can discard a key, with the choice of execution architecture determining which savings are available.

The large-join discussion provides a useful companion to the sparse case. In Q9, the problem is processing a substantial join whose accesses are not conveniently grouped, even when an adjacent join has a good physical layout. The outcomes the authors consider depend on which resources become scarce. A sufficiently large memory can avoid temporary disk traffic. Compatible partitioning can help on one join edge. Replicating some tables can save communication while increasing the footprint across the cluster. These comparisons locate the constraint an intervention addresses and explain why solving it in part of the plan can leave substantial work elsewhere.

A similar distinction applies to the correlation between dates. The generator's date rules explain why a predicate can constrain rows on the other side of a join. Clustered indexes, partition metadata and minimum and maximum summaries explain how a system could exploit the constraint. This separates the existence of a useful relationship in the data from the engine's ability to find it and turn it into fewer accesses. A scan can still encounter useful physical locality even when the optimizer lacks the statistics needed to recognize the best plan in advance.

#### Narrow choices and combined changes need different interpretations

In the expression analysis, the width of an operand is a case where the mechanism is unusually direct. A narrow integer lets the instruction process more tuple values together. Widening is needed at the stage where the price is multiplied by the discount factor. The paper contrasts keeping those widths specific to the operation with using the widest representation throughout. According to the text, four of the Q1 example’s six arithmetic operations would each take four times as long with the wider representation. This is a comparison about the arithmetic operations in that example. The potential end-to-end effect also depends on the rest of the query.

Common subexpression elimination targets a different cost. The paper counts six arithmetic operations before reuse and four once shared computations are recognized. The change removes repeated arithmetic rather than increasing the amount done by an instruction. Deriving an average after accumulating its sum and count is another example of keeping repeated work out of the scan. These operation counts explain what an optimizer can remove without requiring a timing comparison between complete database engines.

Q19's reported improvement concerns evaluation order under changing selectivity. A fixed order works according to what the planner expects the predicates to reject. The adaptive alternative can react to what the scan actually encounters. The case supports that mechanism in VectorWise under the conditions described. The paper also makes correctness a condition of the comparison. Reordering requires care when expressions can raise errors or encounter SQL null values, since changing which tests are evaluated can affect behavior.

Q17 has a different evidentiary shape. It shows what can happen when several improvements apply to the same query and the engine uses them together. The structure of the plan explains their roles, but the reported speedup belongs to the combination. To measure the contribution of reuse alone, for instance, one would need timings of plans that differ on reuse while holding the other relevant choices fixed. The paper gives the combined result, so it establishes the scale of the reported improvement for that case and leaves an attribution to individual changes open.

### Limitations

#### Limits the authors identify

The authors acknowledge that the parallelism ratings in their classification depend on an assumption about physical design. They rate queries on the basis that ORDERS and LINEITEM are partitioned compatibly. Under that assumption, some work can be handled locally, with added tables making the distributed plan more demanding. A single-server system can parallelize work across cores without organizing the tables in this fashion. The paper therefore presents the parallelism ratings as judgments under a stated assumption, and recognizes that they are open to debate.

Benchmark rules determine which operations are exercised. TPC-H excludes materialized views, so the paper treats the performance of those views as outside what the workload measures. The refresh workload also differs from warehouse maintenance organized by time. Its inserts and deletions are not time-correlated, so the ability to remove an old time partition efficiently is outside the benefit the authors attribute to partitioning in this workload. The partitioning cases they analyze concern pruning during scans and joins.

The paper also describes ways that a benchmark configuration can avoid a problem the query makes possible. A system with enough main memory can keep a large join from spilling to disk. A distributed implementation can copy particular tables across workers and avoid some network movement, with the absence of refresh changes to those tables reducing the cost of this choice in TPC-H. Q9 therefore exposes the circumstances that make out-of-core or communication-heavy joins difficult, while the actual demand on a given implementation depends on memory and placement.

Repetition at high stream counts is a limitation the authors identify in the workload generator. Small parameter domains allow the same query to appear again. This makes a run sensitive to a generally available caching feature, and repeated work may become a smaller part of the cost for engines that can reuse it. The paper's account of the rules constrains how the reuse can be configured. The observation still matters when reading throughput as evidence about processing a sequence of independent, newly posed requests.

Finally, the authors describe efficient query parallelism on many-core systems as an open problem at the time of writing. A query can be highly parallel in principle and still encounter coordination costs or a bottleneck within a join implementation. The classification identifies where these issues arise. Its judgments reflect the hardware and systems discussed in the paper.

#### Limits that follow from the evidence

The qualitative impact ratings are best read as descriptions of opportunities for an engine with relevant physical choices. They do not give percentages of elapsed time or specify a universal ordering of bottlenecks. A query that is expensive when the data must be read from disk may behave differently when its working set is resident in memory. An optimizer can carry forward useful tuple order only when its implementation of the preceding operators provides that property. The benchmark supplies settings in which the capability can matter, while its measured importance comes from a particular plan and configuration.

The numerical examples have case-specific baselines. Q2 gives changes for a join and the full query in VectorWise. Q19 gives the effect of an adaptive expression decision in that engine. Q17 gives a combined plan improvement in HyPer. The paper does not present common run conditions and elapsed times for these cases. Taken together, they explain different mechanisms. They cannot be combined into a comparative product ranking or an estimate of the average payoff of a choke point.

The relationship between the TPC-H generator and the date-pruning examples also limits what can be inferred. The generator establishes bounded date offsets. Those bounds make it possible to derive safe candidate ranges in the benchmark. Applying the same reasoning elsewhere requires dependable evidence about the relationships in that dataset, along with a way to exploit the relationship in storage or execution. Some of the paper's mechanisms, such as conservative bounds by table region, show how a system can obtain useful evidence. The measured or expected selectivity of a TPC-H date predicate remains specific to the cases the paper describes.

One numerical illustration should be read with particular care. The paper gives `[0.00:0.10]` as the discount range, then uses `[0.00:0.90]` for the factor in the overflow example. With a discount at the stated lower endpoint, the expression `1 − l_discount` exceeds the stated upper endpoint of that factor. The example therefore cannot serve as a verified bound for omitting the check as written. The general technique depends on deriving valid bounds for the actual operands and checking that they fit the chosen representation.

The historical standings of the columnar systems are likewise evidence about complete systems. Those systems differed in the way they stored data and could also differ in compression, execution, planning and other parts of the configuration. The observation is consistent with the paper's account of why narrower scans help TPC-H. The article's storage reasoning identifies a cause worth examining, while the standings leave its contribution to the score unmeasured.

### What came after

The later work with a documented citation is Leis and colleagues' paper on query optimization and the Join Order Benchmark. Its stated subject takes up a narrower problem than the TPC-H analysis. Boncz, Neumann and Erling treat join ordering as a choke point within a broad decision-support workload, where it interacts with selectivity, the shape of intermediate results and the legal ways to arrange joins. The later paper places query optimization at the center of an investigation built around running a join-order benchmark. [Query Optimization Through the Looking Glass, and What We Found Running the Join Order Benchmark](https://md.research.elamur.ai/free/en/papers/leis-2018-query-optimization-through-looking-glass/)

The connection is the use of a workload to examine a particular part of database behavior. In the TPC-H paper, join ordering is one reason that the same logical request can demand very different amounts of work. An investigation organized around the Join Order Benchmark makes that aspect of planning its direct subject. The citation establishes the connection between the works, and the later paper's title identifies the focus of its investigation. It gives no basis for attributing a particular experimental procedure, finding or reuse of the TPC-H classification to that study.

## Cite

Cite as Peter A. Boncz, Thomas Neumann and Orri Erling. 2014. TPC-H Analyzed: Hidden Messages and Lessons Learned from an Influential Benchmark. Lecture notes in computer science.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1007/978-3-319-04936-6_5](https://doi.org/10.1007/978-3-319-04936-6_5)

```bibtex
@inproceedings{boncz2014tpc,
  title = {{TPC-H Analyzed: Hidden Messages and Lessons Learned from an Influential Benchmark}},
  author = {Peter A. Boncz, Thomas Neumann and Orri Erling},
  booktitle = {Lecture notes in computer science},
  year = {2014},
  doi = {10.1007/978-3-319-04936-6\_5},
  url = {https://doi.org/10.1007/978-3-319-04936-6_5}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
