Просмотр исходного кода

extra index to speed up threadview posts queries

Rafał Pitoń 8 лет назад
Родитель
Сommit
dace9dce47
2 измененных файлов с 2 добавлено и 0 удалено
  1. 1 0
      misago/threads/migrations/0001_initial.py
  2. 1 0
      misago/threads/models/post.py

+ 1 - 0
misago/threads/migrations/0001_initial.py

@@ -198,6 +198,7 @@ class Migration(migrations.Migration):
         migrations.AlterIndexTogether(
             name='post',
             index_together=set([
+                ('thread', 'id'),
                 ('is_event', 'is_hidden'),
                 ('poster', 'posted_on'),
             ]),

+ 1 - 0
misago/threads/models/post.py

@@ -78,6 +78,7 @@ class Post(models.Model):
 
     class Meta:
         index_together = [
+            ('thread', 'id'), # speed up threadview for team members
             ('is_event', 'is_hidden'),
             ('poster', 'posted_on')
         ]