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

feat: Prefetch page content version objects for faster page tree #418

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Jul 22, 2024

Description

To improve responsiveness of the page tree for large sites (in terms of pages), this PR adds a prefetch_related to the admin query sets and evaluates prefetched version objects where available.

This, for example, removes the N+1 issue when getting the state indicators. With a prefetched page content query set evaluating the state indicator does not require a db query.

Note: Currently, the django CMS core does not respect the admin get_queryset method which would contain the prefetch_related rule. This is fixed by django-cms/django-cms#7956

Merging of django-cms/django-cms#7956 is required to have a test for this PR.

Related resources

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

@fsbraun fsbraun marked this pull request as draft July 26, 2024 10:36
@fsbraun fsbraun marked this pull request as ready for review August 15, 2024 10:03
@fsbraun fsbraun requested a review from a team September 3, 2024 13:19
@fsbraun fsbraun merged commit ac763d9 into master Sep 4, 2024
109 checks passed
@fsbraun fsbraun deleted the feat/prefetched-version-objects branch October 29, 2024 18:37
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.

2 participants