Skip to content

Commit

Permalink
Updated db index for concept/mapping repo resources query
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Feb 8, 2024
1 parent f03d120 commit 8e36f56
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.4 on 2024-02-08 05:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('concepts', '0074_concept_repo_version_concepts'),
]

operations = [
migrations.RemoveIndex(
model_name='concept',
name='repo_version_concepts',
),
migrations.AddIndex(
model_name='concept',
index=models.Index(condition=models.Q(('is_active', True), ('retired', False)), fields=['id', '-updated_at'], name='repo_version_concepts'),
),
]
2 changes: 1 addition & 1 deletion core/concepts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Meta:
models.Index(fields=['version']),
models.Index(
name='repo_version_concepts',
fields=['id'],
fields=['id', '-updated_at'],
condition=Q(is_active=True, retired=False)
)
] + VersionedModel.Meta.indexes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.4 on 2024-02-08 05:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mappings', '0052_mapping_repo_version_mappings'),
]

operations = [
migrations.RemoveIndex(
model_name='mapping',
name='repo_version_mappings',
),
migrations.AddIndex(
model_name='mapping',
index=models.Index(condition=models.Q(('is_active', True), ('retired', False)), fields=['-updated_at'], name='repo_version_mappings'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.4 on 2024-02-08 05:21

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mappings', '0053_remove_mapping_repo_version_mappings_and_more'),
]

operations = [
migrations.RemoveIndex(
model_name='mapping',
name='repo_version_mappings',
),
migrations.AddIndex(
model_name='mapping',
index=models.Index(condition=models.Q(('is_active', True), ('retired', False)), fields=['id', '-updated_at'], name='repo_version_mappings'),
),
]
2 changes: 1 addition & 1 deletion core/mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Meta:
),
models.Index(
name='repo_version_mappings',
fields=['id'],
fields=['id', '-updated_at'],
condition=Q(is_active=True, retired=False)
),
] + VersionedModel.Meta.indexes
Expand Down

0 comments on commit 8e36f56

Please sign in to comment.