1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

For backup persitsence, mark the "common ngrams" table as a data table, not an index table

Summary:
Ref T13000. Garbage collecting common ngrams is slow because MySQL isn't all that great at deleting rows quickly. See PHI96, where it looks like it's going to take a week to GC ngrams for a ~million objects at a relatively conservative 0.15 threshold.

In the event of a restore, we can reduce the impact by persisting this table so the ngrams just don't get built when the reindex happens.

Test Plan: Viewed schema in Config, saw common ngrams tables marked as "Data" instead of "Index".

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13000

Differential Revision: https://secure.phabricator.com/D18696
This commit is contained in:
epriestley 2017-10-09 17:01:56 -07:00
parent 5897294fa9
commit 821c7ac833

View file

@ -81,12 +81,15 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
$engine->getNgramsSchemaKeys(), $engine->getNgramsSchemaKeys(),
$index_options); $index_options);
// NOTE: The common ngrams table is not marked as an index table. It is
// tiny and persisting it across a restore saves us a lot of work garbage
// collecting common ngrams from the index after it gets built.
$this->buildRawSchema( $this->buildRawSchema(
$engine->getApplicationName(), $engine->getApplicationName(),
$engine->getCommonNgramsTableName(), $engine->getCommonNgramsTableName(),
$engine->getCommonNgramsSchemaColumns(), $engine->getCommonNgramsSchemaColumns(),
$engine->getCommonNgramsSchemaKeys(), $engine->getCommonNgramsSchemaKeys());
$index_options);
} }
protected function buildRawSchema( protected function buildRawSchema(