Skip to content

Conversation

mbertrand
Copy link
Member

@mbertrand mbertrand commented Aug 26, 2025

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/8259

Description (What does it do?)

  • Prefetches learning resource children to avoid n+1 queries

How can this be tested?

Assuming you already have a bunch of programs and podcasts in your database:

Check the logs, you'll likely see lots of n+1 queries

You should no longer see any n+1 queries, just "Potential unnecessary eager load" which is okay. The children attribute of the results for each resource should be identical with the main branch results.

@mbertrand mbertrand added the Needs Review An open Pull Request that is ready for review label Aug 26, 2025
@abeglova abeglova self-assigned this Aug 27, 2025
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

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

👍

@mbertrand mbertrand merged commit c10230f into main Aug 27, 2025
13 checks passed
@mbertrand mbertrand deleted the mb/no_n_1 branch August 27, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review An open Pull Request that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants