Change index in ::search_matches table

Before /* Затронуто строк: 0  Найденные строки: 700 996  Предупреждения: 0  Длительность  1 запрос: 0,063 sec. (+ 44,990 sec. network) */
After  /* Затронуто строк: 0  Найденные строки: 700 996  Предупреждения: 0  Длительность  1 запрос: 0,000 sec. (+ 1,154 sec. network) */
This commit is contained in:
Visman 2023-07-16 11:36:50 +07:00
parent abf9625e47
commit ddc3cafbd6
2 changed files with 4 additions and 1 deletions

View file

@ -981,7 +981,7 @@ class Install extends Admin
'subject_match' => ['TINYINT(1)', false, 0],
],
'INDEXES' => [
'word_id_idx' => ['word_id'],
'multi_idx' => ['word_id', 'post_id'],
'post_id_idx' => ['post_id'],
],
'ENGINE' => $this->DBEngine,

View file

@ -741,6 +741,9 @@ class Update extends Admin
$this->c->DB->dropIndex('::posts', 'multi_idx');
$this->c->DB->addIndex('::posts', 'multi_idx', ['poster_id', 'topic_id', 'posted']);
$this->c->DB->dropIndex('::search_matches', 'word_id_idx');
$this->c->DB->addIndex('::search_matches', 'multi_idx', ['word_id', 'post_id']);
return null;
}
}