Added an index for (doc, type) on DocEvent to speed up latest_event() queries.
- Legacy-Id: 14990
This commit is contained in:
parent
4da044e2db
commit
43a9291053
19
ietf/doc/migrations/0003_auto_20180401_1231.py
Normal file
19
ietf/doc/migrations/0003_auto_20180401_1231.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-04-01 12:31
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('doc', '0002_auto_20180220_1052'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddIndex(
|
||||
model_name='docevent',
|
||||
index=models.Index(fields=[b'type', b'doc'], name='doc_doceven_type_43e53e_idx'),
|
||||
),
|
||||
]
|
|
@ -1000,6 +1000,9 @@ class DocEvent(models.Model):
|
|||
|
||||
class Meta:
|
||||
ordering = ['-time', '-id']
|
||||
indexes = [
|
||||
models.Index(fields=['type', 'doc']),
|
||||
]
|
||||
|
||||
class NewRevisionDocEvent(DocEvent):
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue