Example of partitioning
Suppose you maintain a set of customer name files. The customers live in three cities. Sometimes you need to access the customer LRECs directly and sometimes you need to process a set by city.
Assume that the number of customers is such that algorithm #TPFDB01 is appropriate. This means that you need 26 prime blocks for each file (partition).
Table 1 shows the customers allocated to ordinals in each file on the basis of the first character in their surname (algorithm #TPFDB01) and to a partition on the basis of which city they live in (Rome=1, Paris=2, London=3).
The total number of ordinals (blocks) required for all 3 partitions is 78 (26 x 3).
| Customer name | City | Partition number | Ordinal number in the file (partition) | Ordinal number in the fixed file |
|---|---|---|---|---|
| Adams | Rome | 1 | 0 | 0 |
| Andrews | Rome | 1 | 0 | 0 |
| Bernoulli | Rome | 1 | 1 | 1 |
| Rodriquez | Rome | 1 | 17 | 17 |
| Zerlini | Rome | 1 | 25 | 25 |
| Andrews | Paris | 2 | 0 | 26 |
| Zeisel | Paris | 2 | 25 | 51 |
| Alans | London | 3 | 0 | 52 |
| Zimmerman | London | 3 | 0 | 77 |