CRM/Upgrade - Store snapshots with compression. More comments.
authorTim Otten <totten@civicrm.org>
Mon, 23 May 2022 21:45:54 +0000 (14:45 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 24 May 2022 05:15:10 +0000 (22:15 -0700)
CRM/Upgrade/Snapshot.php

index 56bda5d002e6790161e08f6e8122aa3f572472ea..442aed6de1bed80d0ae55aa4844ba62551438a94 100644 (file)
@@ -119,7 +119,8 @@ class CRM_Upgrade_Snapshot {
         'MIN' => $offset,
         'MAX' => $offset + $pageSize,
       ]);
-      $sqlAction = ($offset === 0) ? "CREATE TABLE {$destTable} AS " : "INSERT INTO {$destTable} ";
+      $sqlAction = ($offset === 0) ? "CREATE TABLE {$destTable} ROW_FORMAT=COMPRESSED AS " : "INSERT INTO {$destTable} ";
+      // Note: 'CREATE TABLE AS' implicitly preserves the character-set of the source-material, so we don't set that explicitly.
       yield new CRM_Queue_Task(
         [static::class, 'insertSnapshotTask'],
         [$sqlAction . $pageSelect->toSQL()],