Skip to content

Commit d76a7bf

Browse files
committed
OpenConceptLab/ocl_issues#1035 Slow concepts select
1 parent 010667c commit d76a7bf

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 3.2.7 on 2021-10-12 10:25
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('concepts', '0019_auto_20210914_1420'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveIndex(
14+
model_name='concept',
15+
name='concepts_is_acti_7190c6_idx',
16+
),
17+
migrations.AddIndex(
18+
model_name='concept',
19+
index=models.Index(fields=['is_active', 'retired', 'is_latest_version', 'public_access', 'updated_at'], name='concepts_is_acti_ee42ab_idx'),
20+
),
21+
]

core/concepts/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Meta:
143143
db_table = 'concepts'
144144
unique_together = ('mnemonic', 'version', 'parent')
145145
indexes = [
146-
models.Index(fields=['is_active', 'retired', 'is_latest_version', 'public_access']),
146+
models.Index(fields=['is_active', 'retired', 'is_latest_version', 'public_access', 'updated_at']),
147147
] + VersionedModel.Meta.indexes
148148

149149
external_id = models.TextField(null=True, blank=True)

0 commit comments

Comments
 (0)