فهرست منبع

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) */
Visman 2 سال پیش
والد
کامیت
ddc3cafbd6
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 1 1
      app/Models/Pages/Admin/Install.php
  2. 3 0
      app/Models/Pages/Admin/Update.php

+ 1 - 1
app/Models/Pages/Admin/Install.php

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

+ 3 - 0
app/Models/Pages/Admin/Update.php

@@ -741,6 +741,9 @@ class Update extends Admin
         $this->c->DB->dropIndex('::posts', 'multi_idx');
         $this->c->DB->dropIndex('::posts', 'multi_idx');
         $this->c->DB->addIndex('::posts', 'multi_idx', ['poster_id', 'topic_id', 'posted']);
         $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;
         return null;
     }
     }
 }
 }