Skip to content

Commit 43a9291

Browse files
committed
Added an index for (doc, type) on DocEvent to speed up latest_event() queries.
- Legacy-Id: 14990
1 parent 4da044e commit 43a9291

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.11 on 2018-04-01 12:31
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('doc', '0002_auto_20180220_1052'),
12+
]
13+
14+
operations = [
15+
migrations.AddIndex(
16+
model_name='docevent',
17+
index=models.Index(fields=[b'type', b'doc'], name='doc_doceven_type_43e53e_idx'),
18+
),
19+
]

ietf/doc/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,9 @@ def save(self, *args, **kwargs):
10001000

10011001
class Meta:
10021002
ordering = ['-time', '-id']
1003+
indexes = [
1004+
models.Index(fields=['type', 'doc']),
1005+
]
10031006

10041007
class NewRevisionDocEvent(DocEvent):
10051008
pass

0 commit comments

Comments
 (0)