Cleanup comments in xlog compression
authorStephen Frost <[email protected]>
Thu, 6 Dec 2018 16:05:39 +0000 (11:05 -0500)
committerStephen Frost <[email protected]>
Thu, 6 Dec 2018 16:05:39 +0000 (11:05 -0500)
Skipping over the "hole" in full page images in the XLOG code was
described as being a form of compression, but this got a bit confusing
since we now have PGLZ-based compression happening, so adjust the
wording to discuss "removing" the "hole" and keeping the talk about
compression to where we're talking about using PGLZ-based compression of
the full page images.

Reviewed-By: Kyotaro Horiguchi
Discussion: https://postgr.es/m/20181127234341[email protected]

src/backend/access/transam/xloginsert.c
src/include/access/xlogrecord.h

index 34d4db42977e74f3d55987828696503d31e99b3d..034d5b3b6246bd1ecc473e086d51e258126d5f50 100644 (file)
@@ -605,7 +605,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
                                }
                                else
                                {
-                                       /* No "hole" to compress out */
+                                       /* No "hole" to remove */
                                        bimg.hole_offset = 0;
                                        cbimg.hole_length = 0;
                                }
index 863781937e48140567fd85e50f04df4dc94e5bb4..f594d600ada77cc24966366544f9163c152088bf 100644 (file)
@@ -107,15 +107,14 @@ typedef struct XLogRecordBlockHeader
  * Additional header information when a full-page image is included
  * (i.e. when BKPBLOCK_HAS_IMAGE is set).
  *
- * As a trivial form of data compression, the XLOG code is aware that
- * PG data pages usually contain an unused "hole" in the middle, which
- * contains only zero bytes.  If the length of "hole" > 0 then we have removed
- * such a "hole" from the stored data (and it's not counted in the
- * XLOG record's CRC, either).  Hence, the amount of block data actually
- * present is BLCKSZ - the length of "hole" bytes.
+ * The XLOG code is aware that PG data pages usually contain an unused "hole"
+ * in the middle, which contains only zero bytes.  Since we know that the
+ * "hole" is all zeros, we remove it from the stored data (and it's not counted
+ * in the XLOG record's CRC, either).  Hence, the amount of block data actually
+ * present is (BLCKSZ - <length of "hole" bytes>).
  *
- * When wal_compression is enabled, a full page image which "hole" was
- * removed is additionally compressed using PGLZ compression algorithm.
+ * Additionally, when wal_compression is enabled, we will try to compress full
+ * page images using the PGLZ compression algorithm, after removing the "hole".
  * This can reduce the WAL volume, but at some extra cost of CPU spent
  * on the compression during WAL logging. In this case, since the "hole"
  * length cannot be calculated by subtracting the number of page image bytes