-
Notifications
You must be signed in to change notification settings - Fork 32
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
Meta: 📈 Performance of PageTreeView
#886
Comments
PageTreeView
The same problem probably also impacts the translation report (which takes even longer to load than the page tree) |
The culprit seem to be many small queries that are executed each time the https://docs.djangoproject.com/en/3.2/topics/db/optimization/ provides some insights into how Django internally optimizes database access. The following things can be done to improve performance:
We should start with the |
I enabled the Postgresql query log and collected the queries executed during one API request on the pages endpoint. Each SQL query is one line in the log file.
The result contains 68 page translations. That means we execute about 100 SQL queries for each page returned via the API. |
As a kinda dirty approach for reducing the database calls we implemented one example for the abstract_base_page.py. We added an additional value and then changed the get_translation() method to the following:
This removes the filter() function from the property and saves up a lot of database connections. |
PageTreeView
PageTreeView
Since after merging #1149 the performance of the page tree is very good even in regions with many pages, I'm closing this issue now. 🎉 |
PageTreeView
PageTreeView
Motivation
Currently, TreeView loading has some massive perforamce issues when we work with live data. For example, loading the pages of the city of Munich takes almost 2 minutes. This needs to improve significantly before the release.
The text was updated successfully, but these errors were encountered: