Optimize Course Progress Queries for Large Course Lists?

I’m working on a feature that classifies a user’s courses into “in-progress” or “completed” states. I don’t need to show the exact progress percentage—just determine the state. The challenge arises when users are enrolled in a large number of courses, which makes checking the completion status for each course slow due to heavy DB queries.

Also, the course structure isn’t fixed and new content can be added at any time, so the solution needs to automatically reflect updates without manual intervention. Is there a scalable and efficient way to track this kind of status in Open edX without hitting performance issues as the course list grows or changes dynamically?

@harshpatel463 where are you intending to expose this information to users?

Would openedx-completion-aggregator meet your needs? It’s designed for this sort of use case. Though if you don’t need the exact percentage there should be some sort of “completed” / “certificate issued” / “passed” status stored somewhere in the LMS database, right? I’m just not sure off the top of my head where that is.

I’m not aiming to display detailed progress percentages to users. Instead, I simply want to categorize courses into “In Progress” and “Completed” on the user dashboard. This helps present a cleaner and more intuitive view of a learner’s current status across courses. The main challenge I’m facing is performance — especially when a user is enrolled in many courses.

Thanks, Braden! I’m using the completion-aggregator, and it works well for calculating progress. However, my main concern is that the course structure isn’t fixed — content is frequently updated (e.g., blocks added or removed). Because of this, I find myself needing to run the run_aggregator_service command repeatedly to update progress accurately.

I’m looking for a more efficient or automated way to ensure progress stays updated when the course content changes, especially since I only need to classify courses into “In Progress” and “Completed.” Is there a built-in mechanism to check the course completion?

Isn’t that normal though? Per the README, that command should be run via a cron job, e.g. hourly. Or do your courses update more frequently than that?