diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAnalyzeWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAnalyzeWorkflow.php index 54a4bf3d36..6fe3e60926 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAnalyzeWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAnalyzeWorkflow.php @@ -12,7 +12,8 @@ final class PhabricatorStorageManagementAnalyzeWorkflow } public function didExecute(PhutilArgumentParser $args) { - $this->analyzeTables(); + $api = $this->getSingleAPI(); + $this->analyzeTables($api); return 0; } diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php index 85d0c09c73..a03ef41c4d 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php @@ -143,7 +143,7 @@ abstract class PhabricatorStorageManagementWorkflow if (!$this->dryRun) { $should_analyze = (($err == 0) || ($err == 2)); if ($should_analyze) { - $this->analyzeTables(); + $this->analyzeTables($api); } } } catch (Exception $ex) { @@ -1172,12 +1172,13 @@ abstract class PhabricatorStorageManagementWorkflow ->lock(); } - final protected function analyzeTables() { + final protected function analyzeTables( + PhabricatorStorageManagementAPI $api) { + // Analyzing tables can sometimes have a significant effect on query // performance, particularly for the fulltext ngrams tables. See T12819 // for some specific examples. - $api = $this->getSingleAPI(); $conn = $api->getConn(null); $patches = $this->getPatches();