#32711: MySQL performance regression in
forms.models.apply_limit_choices_to_to_formfield
------------------------------------+--------------------------------------
Reporter: Thomas Achtemichuk | Owner: nobody
Type: Uncategorized | Status: closed
Component: Forms | Version: 3.2
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Comment (by Simon Charette):
> It looks that you don't have an index on auth_user.id, but I don't know
why.
I doubt that's the issue, MySQL is just notably really picky with regards
to subqueries optimizations
https://dev.mysql.com/doc/refman/5.7/en/subquery-optimization-with-
exists.html
It seems we are properly following the docs though with our
`outer_expr=inner_expr` usage via `U0.id = auth_user.id` unless MySQL
doesn't like swapping us to `inner_expr=outer_expr` format?
Thomas, are you using the latest version of MySQL 5.7 and does swapping
`AND U0.id = auth_user.id` to `AND auth_user.id = U0.id` in the subquery
make any difference?
--
Ticket URL: <https://code.djangoproject.com/ticket/32711#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.c6f1a94510f9dea2e8c9bcb8d852ec5f%40djangoproject.com.