-
Notifications
You must be signed in to change notification settings - Fork 161
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
Optimisation des requêtes SQL sur la page d'accueil #6101
Conversation
32cf716
to
a80ceb4
Compare
@@ -215,8 +215,6 @@ def get_last_tutorials(self, number=0): | |||
self.filter(type="TUTORIAL") | |||
.filter(public_version__isnull=False) | |||
.prefetch_related("authors") | |||
.prefetch_related("authors__profile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ça ne va pas être gênant de ne pas la charger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non car cette fonction n'est utilisée que pour la page d'accueil et dans celle-ci pour les contenus on ne fait pas appel au profil des auteurs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rapport de QA
Voici les mesures que moi j'obtiens:
connecté:
default 86.45 ms (140 requêtes including 100 similar and 24 duplicates )
default 55.70 ms (107 requêtes including 80 similar and 24 duplicates )
==> default 56.56 ms (99 requêtes including 63 similar and 8 duplicates )
default 56.56 ms (99 requêtes including 63 similar and 8 duplicates )
anonyme:
default 27.77 ms (111 requêtes including 84 similar and 22 duplicates )
default 22.03 ms (82 requêtes including 64 similar and 22 duplicates )
==> default 45.13 ms (82 requêtes including 56 similar and 8 duplicates )
default 34.57 ms (53 requêtes including 36 similar and 8 duplicates )
Ça diminue bien et tout fonctionne, donc c'est OK ✔️
@artragis je te laisse approuver et merger
Optimisation des requêtes SQL sur la page d'accueil
Avant
Après
La différence entre la première requête et les autres est due au cache.