diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ccc076a..e622973 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,11 @@ Change Log Unreleased +[1.53.0] - 2024-08-22 +--------------------- +* perf: Introduced db_index on the `created` and `is_blacklisted` fields in `XBlockSkillData` model + for performance improvements of `xblocks` endpoint + [1.52.0] - 2024-08-22 --------------------- * feat: Added a search feature on skill field in CourseSkills diff --git a/taxonomy/__init__.py b/taxonomy/__init__.py index d616d56..d450b26 100644 --- a/taxonomy/__init__.py +++ b/taxonomy/__init__.py @@ -15,6 +15,6 @@ # 2. MINOR version when you add functionality in a backwards compatible manner, and # 3. PATCH version when you make backwards compatible bug fixes. # More details can be found at https://semver.org/ -__version__ = '1.52.0' +__version__ = '1.53.0' default_app_config = 'taxonomy.apps.TaxonomyConfig' # pylint: disable=invalid-name diff --git a/taxonomy/api/v1/views.py b/taxonomy/api/v1/views.py index 776330f..fd1db4c 100644 --- a/taxonomy/api/v1/views.py +++ b/taxonomy/api/v1/views.py @@ -297,7 +297,6 @@ class XBlockSkillsViewSet(TaxonomyAPIViewSetMixin, RetrieveModelMixin, ListModel If skill validation is disabled for a course, then return an empty queryset. """ serializer_class = XBlocksSkillsSerializer - permission_classes = (permissions.IsAuthenticated, ) filter_backends = (DjangoFilterBackend,) filterset_class = XBlocksFilter diff --git a/taxonomy/migrations/0037_alter_xblockskilldata_is_blacklisted_and_more.py b/taxonomy/migrations/0037_alter_xblockskilldata_is_blacklisted_and_more.py new file mode 100644 index 0000000..b2a027c --- /dev/null +++ b/taxonomy/migrations/0037_alter_xblockskilldata_is_blacklisted_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.14 on 2024-08-22 09:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('taxonomy', '0036_auto_20240325_1631'), + ] + + operations = [ + migrations.AlterField( + model_name='xblockskilldata', + name='is_blacklisted', + field=models.BooleanField(db_index=True, default=False, help_text='Blacklist this xblock skill, useful to handle false positives.'), + ), + migrations.AddIndex( + model_name='xblockskilldata', + index=models.Index(fields=['created'], name='taxonomy_xb_created_5929ec_idx'), + ), + ] diff --git a/taxonomy/models.py b/taxonomy/models.py index defd241..2d0da36 100644 --- a/taxonomy/models.py +++ b/taxonomy/models.py @@ -238,7 +238,7 @@ class XBlockSkillData(TimeStampedModel): ) is_blacklisted = models.BooleanField( help_text=_('Blacklist this xblock skill, useful to handle false positives.'), - default=False, + default=False, db_index=True ) class Meta: @@ -251,6 +251,9 @@ class Meta: ordering = ('created', ) app_label = 'taxonomy' unique_together = ('xblock', 'skill') + indexes = [ + models.Index(fields=['created']), + ] def __str__(self): """