|
23 | 23 | /* |
24 | 24 | * For encoding purposes, item pointers are represented as 64-bit unsigned |
25 | 25 | * integers. The lowest 11 bits represent the offset number, and the next |
26 | | - * lowest 32 bits are the block number. That leaves 17 bits unused,ie. |
| 26 | + * lowest 32 bits are the block number. That leaves 17 bits unused,i.e. |
27 | 27 | * only 43 low bits are used. |
28 | 28 | * |
29 | 29 | * These 43-bit integers are encoded using varbyte encoding. In each byte, |
|
51 | 51 | * Removing number is actually replacement of two numbers with their sum. We |
52 | 52 | * have to prove that varbyte encoding of a sum can't be longer than varbyte |
53 | 53 | * encoding of its summands. Sum of two numbers is at most one bit wider than |
54 | | - *thanthe larger of the summands. Widening a number by one bit enlarges its |
55 | | - *lengthin varbyte encoding by at most one byte. Therefore, varbyte encoding |
56 | | - *of sumis at most one byte longer than varbyte encoding of larger summand. |
57 | | - *Lessersummand is at least one byte, so the sum cannot take more space than |
58 | | - *thesummands, Q.E.D. |
| 54 | + * the larger of the summands. Widening a number by one bit enlarges its length |
| 55 | + * in varbyte encoding by at most one byte. Therefore, varbyte encoding of sum |
| 56 | + * is at most one byte longer than varbyte encoding of larger summand. Lesser |
| 57 | + * summand is at least one byte, so the sum cannot take more space than the |
| 58 | + * summands, Q.E.D. |
59 | 59 | * |
60 | 60 | * This property greatly simplifies VACUUM, which can assume that posting |
61 | 61 | * lists always fit on the same page after vacuuming. Note that even though |
62 | 62 | * that holds for removing items from a posting list, you must also be |
63 | | - * careful to not cause expansion e.g when merging uncompressed items on the |
| 63 | + * careful to not cause expansion e.g. when merging uncompressed items on the |
64 | 64 | * page into the compressed lists, when vacuuming. |
65 | 65 | */ |
66 | 66 |
|
|