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.
[ ] 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.
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 theprefetch_related
rule. This is fixed by https://github.com/django-cms/django-cms/pull/7956Merging of https://github.com/django-cms/django-cms/pull/7956 is required to have a test for this PR.
Related resources
...
Checklist
master