Skip to content

fix: bulk-operation-task-created-index#62

Merged
2usatishkumar merged 1 commit into
masterfrom
fix/bulk-operation-task-created-index
Jul 24, 2026
Merged

fix: bulk-operation-task-created-index#62
2usatishkumar merged 1 commit into
masterfrom
fix/bulk-operation-task-created-index

Conversation

@smaheshkumarreddy-sonata

Copy link
Copy Markdown

This PR adds database indexes to improve the performance of BulkOperationTask queries and prevent database sort memory issues when retrieving bulk operation history.

Changes

  • Added an index on created to optimize queries ordered by created DESC.
  • Added a composite index on (status, created DESC) to optimize filtered queries that order results by creation time.

Copilot AI review requested due to automatic review settings July 23, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds database indexes on BulkOperationTask timestamp/status columns to improve performance for bulk operation history queries (notably ORDER BY created DESC, and WHERE status=... ORDER BY created DESC) and reduce DB sort memory pressure.

Changes:

  • Added an index on created (descending) for faster default ordering by newest tasks.
  • Added a composite index on (status, created DESC) to accelerate status-filtered history queries ordered by newest first.
  • Introduced a Django migration to apply these indexes at the database level.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
course_discovery/apps/course_metadata/models.py Declares two new model-level indexes on BulkOperationTask to match API ordering/filter patterns.
course_discovery/apps/course_metadata/migrations/0361_bulkoperationtask_cm_bo_task_created_idx_and_more.py Adds the corresponding DB indexes via migrations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@2usatishkumar
2usatishkumar self-requested a review July 24, 2026 11:08

@2usatishkumar 2usatishkumar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved!

@2usatishkumar
2usatishkumar merged commit fd7b6bc into master Jul 24, 2026
20 of 21 checks passed
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