Try
↑ ↓ move↵ openesc close
In this lesson · topic 3 of 7
  1. 1. Too much data, too many writes
  2. 2. Range, hash, and splitting
  3. 3. Split a hot range and compare layouts
  4. 4. When one key outruns every partition
  5. 5. Adding a node, and how requests find their partition
  6. 6. Looking up by the column you did not partition on
  7. 7. Check the partitioning rules

Topic 3

Split a hot range and compare layouts

8 min read

Compare the rules

The lab sends a steady stream of requests to a set of partitions and counts them. Pick Compare all partitionings and both rules process the same requests. Bars show each partition’s share of the traffic, with the fair share being one divided by the number of partitions. The strip under a range panel shows where the boundaries sit. Every tick also issues one range scan, and the lab reports how many partitions it had to touch.

Predict before you press the button

Traffic is skewed so that low-numbered keys are the most popular, with a Zipf exponent of 1. You compare eight range partitions with eight hash partitions. Which is true?

Skewed (Zipf) keysbusiest ÷ mean = 6.42 | 1.62Range partitioning | Hash partitioning, loads counted since the last split

Cuts it at the key where half its load lies below. Splits so far: 0.

Range partitioning · 8 partitions

busiest vs mean
6.42x
busiest share
80%
partitions per scan
1.2

Hash partitioning · 8 partitions

busiest vs mean
1.62x
busiest share
20%
partitions per scan
8.0
Busiest partition against the mean
Busiest partition against the mean. Text version available below the chart.1.03.35.57.810.04 ticks32 ticks60 ticksticks runbusiest ÷ mean

Full-page version with guided experiments: Partitioning keys lab.

Things to try

  1. Compare both rules under uniform keys, then sequential keys, then skewed keys.
  2. With skewed keys, raise the skew from 1.0 to 1.4 and watch the hash panel.
  3. With uniform keys, compare partitions per scan between the two rules, then raise the scan length to 2000 keys.
  4. Choose range partitioning with skewed keys and press Split the busiest range partition repeatedly. Pause after each press so the load can build up again.
  5. Do the same with sequential keys.

The full-page lab has five guided experiments with a setup button for each.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms