Hi Patrick,
yes, "key" 3 is duplicated in order to illustrate that this is the partitioning-key (the input into the hash function H(x)) and not a table primary key or something like that.
Looking at it, "key" really is a very ambiguous term in today's database world.
Referring to the example with x = 21: OK, that was a sharp turn there, as I simply wanted to show that even looking for values that are not even present in the whole table, the hash function will lead us to the only possible partition.
For 21 the result of modulo (21, 4) is 1, as 20 can be divided by 4 without remainder.
The remainders map to the partitions like this:
remainder -> partition
0 -> 1
1 -> 2
2 -> 3
3 -> 4
Thus, when we want to find records with the partitioning key 21, we only need to go to partition 2 and search there.
Hope that makes it clearer.
- Lars