#34639: MySQL 8.0 hangs indefinitely when using the admin search with a Foreign 
Key
and Annotate
--------------------------------+------------------------------------
     Reporter:  Nicolas Lupien  |                    Owner:  nobody
         Type:  Bug             |                   Status:  new
    Component:  contrib.admin   |                  Version:  4.2
     Severity:  Normal          |               Resolution:
     Keywords:  mysql           |             Triage Stage:  Accepted
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+------------------------------------
Changes (by Simon Charette):

 * cc: Simon Charette, Mariusz Felisiak, Natalia Bidart (added)


Comment:

 Not sure how actionable the ticket is in its current form so I wonder how
 we should proceed here.

 I can see a few paths forward:

 1. Create an optimization / ORM ticket to have `SQLQuery.exists` and
 `.aggregate` prune unnecessary joins solely used by pruned annotations. It
 doesn't look like we have one already and this is desirable.

 2. Adjust #32433 (6307c3f1a123f5975c73b231e8ac4f115fd72c0d) so the
 `TypeError` is only raised when `distinct(fields)` is used (which was the
 actually reported issue) so #32682
 (187118203197801c6cb72dc8b06b714b23b6dd3d) can be reverted.

 3. Don't attempt to remove duplicates when the queryset is meant to be
 used for deletion purposes as there is no value in doing so but that's
 easier said than done due with how things are currently structured.
 [https://github.com/django/django/compare/main...charettes:django:ticket-34639
 Here's how it could be achieved].

 I think that 1. is desirable no matter what, and that we should choose a
 solution between 2. and 3. I have a slight preference for 2 given it
 relaxes an overly aggressive assertion instead of introducing a feature
 for the sole purpose of working around it.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34639#comment:9>
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/01070188adba47b7-235b9966-a32e-474f-b394-441da2699981-000000%40eu-central-1.amazonses.com.

Reply via email to