Commit e95ffcc
Fix N+1 query on homepage for recent courses (#357)
Add select_related("course") to the recent_views queryset to prevent
multiple database queries when accessing course objects. This resolves
the performance issue where a separate query was executed for each
CourseUserView when building the recent_courses list.
Fixes DOCHUB-21Y
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent ab05747 commit e95ffcc
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
0 commit comments