Skip to content

Commit 088033d

Browse files
committed
Added matching indexes to a number of models with ordering by multiple keys.
- Legacy-Id: 18664
1 parent 9da87c5 commit 088033d

File tree

20 files changed

+226
-0
lines changed

20 files changed

+226
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.2.17 on 2020-11-09 04:29
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('doc', '0037_clean_up_missing_docaliases'),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name='docevent',
15+
index=models.Index(fields=['-time', '-id'], name='doc_doceven_time_1a258f_idx'),
16+
),
17+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 2.2.17 on 2020-11-09 04:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('doc', '0038_auto_20201109_0429'),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name='dochistoryauthor',
15+
index=models.Index(fields=['document', 'order'], name='doc_dochist_documen_7e2441_idx'),
16+
),
17+
migrations.AddIndex(
18+
model_name='documentauthor',
19+
index=models.Index(fields=['document', 'order'], name='doc_documen_documen_7fabe2_idx'),
20+
),
21+
]

ietf/doc/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ def formatted_email(self):
618618
class Meta:
619619
abstract = True
620620
ordering = ["document", "order"]
621+
indexes = [
622+
models.Index(fields=['document', 'order']),
623+
]
621624

622625
class DocumentAuthor(DocumentAuthorInfo):
623626
document = ForeignKey('Document')
@@ -1076,6 +1079,7 @@ class Meta:
10761079
ordering = ['-time', '-id']
10771080
indexes = [
10781081
models.Index(fields=['type', 'doc']),
1082+
models.Index(fields=['-time', '-id']),
10791083
]
10801084

10811085
class NewRevisionDocEvent(DocEvent):
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.2.17 on 2020-11-09 04:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('group', '0037_initial_yc_roles'),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name='groupevent',
15+
index=models.Index(fields=['-time', '-id'], name='group_group_time_ee7c7c_idx'),
16+
),
17+
]

ietf/group/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ def __str__(self):
334334

335335
class Meta:
336336
ordering = ['-time', 'id']
337+
indexes = [
338+
models.Index(fields=['-time', '-id']),
339+
]
337340

338341
class ChangeStateGroupEvent(GroupEvent):
339342
state = ForeignKey(GroupStateName)

ietf/iesg/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ def __str__(self):
8888

8989
class Meta:
9090
ordering = ['-date']
91+
indexes = [
92+
models.Index(fields=['-date',]),
93+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 2.2.17 on 2020-11-09 04:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('ipr', '0007_create_ipr_doc_events'),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name='iprdisclosurebase',
15+
index=models.Index(fields=['-time', '-id'], name='ipr_iprdisc_time_846a78_idx'),
16+
),
17+
migrations.AddIndex(
18+
model_name='iprevent',
19+
index=models.Index(fields=['-time', '-id'], name='ipr_ipreven_time_9630c4_idx'),
20+
),
21+
]

ietf/ipr/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class IprDisclosureBase(models.Model):
3030

3131
class Meta:
3232
ordering = ['-time', '-id']
33+
indexes = [
34+
models.Index(fields=['-time', '-id']),
35+
]
3336

3437
def __str__(self):
3538
return self.title
@@ -247,6 +250,9 @@ def create_doc_events(self):
247250

248251
class Meta:
249252
ordering = ['-time', '-id']
253+
indexes = [
254+
models.Index(fields=['-time', '-id']),
255+
]
250256

251257
class LegacyMigrationIprEvent(IprEvent):
252258
"""A subclass of IprEvent specifically for capturing contents of legacy_url_0,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.2.17 on 2020-11-09 04:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('liaisons', '0006_document_primary_key_cleanup'),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name='liaisonstatementevent',
15+
index=models.Index(fields=['-time', '-id'], name='liaisons_li_time_3e1646_idx'),
16+
),
17+
]

ietf/liaisons/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,6 @@ def __str__(self):
238238

239239
class Meta:
240240
ordering = ['-time', '-id']
241+
indexes = [
242+
models.Index(fields=['-time', '-id']),
243+
]

0 commit comments

Comments
 (0)