Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: add index to is_blacklisted and created field for performance improvements of xblocks api #202

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

AfaqShuaib09
Copy link
Contributor

@AfaqShuaib09 AfaqShuaib09 commented Aug 22, 2024

PROD-4136

This PR focuses on the performance improvements for xblocks api for skill fetching by adding db_indexes on the fields pointed out by the explain query.

Merge checklist:

  • Any new requirements are in the right place (do not manually modify the requirements/*.txt files)
    • make upgrade && make requirements have been run to regenerate requirements
  • ./manage.py makemigrations has been run
    • Checkout the Database Migration Confluence page for helpful tips on creating migrations.
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.
  • Version bumped
  • Changelog record added

Post merge:

  • Tag pushed and a new version released
    • Note: Assets will be added automatically. You just need to provide a tag (should match your version number) and title and description.
  • After versioned build finishes in GitHub Actions, verify version has been pushed to PyPI
    • Each step in the release build has a condition flag that checks if the rest of the steps are done and if so will deploy to PyPi.
      (so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
  • PR created in course-discovery to upgrade dependencies (including taxonomy-connector)
    • This must be done after the version is visible in PyPi as make upgrade in course-discovery will look for the latest version in PyPi.

@@ -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, )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This permission class is already present in TaxonomyAPIViewSetMixin, from which it is inherited, so I believe we can remove it from here

@AfaqShuaib09 AfaqShuaib09 changed the title perf: add index to is_blacklisted and created field for performance improvements for xblocks api perf: add index to is_blacklisted and created field for performance improvements of xblocks api Aug 22, 2024
@AfaqShuaib09 AfaqShuaib09 marked this pull request as ready for review August 23, 2024 06:30
@AfaqShuaib09 AfaqShuaib09 merged commit db7339a into master Aug 23, 2024
10 checks passed
@AfaqShuaib09 AfaqShuaib09 deleted the afaq/prod-4136 branch August 23, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants