--
Ticket URL: <https://code.djangoproject.com/ticket/16063>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
This seems related to #13902 and #15819. Are you able to test if this gets
fixed by using Django 1.3 or trunk?
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:1>
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Looking at the code, the part that is modified by the patch is not
modified in current trunk. The problematic pattern is still there:
{{{
for bit in self.query.split():
...
qs = qs.filter(...)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:2>
* type: Bug => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:3>
Comment (by esizikov):
I have checked with Django 1.3 and can now confirm that the problem is
still there. Django's ORM in 1.3 still generates SELECT with JOIN's for
each {{{ qs = qs.filter(...) }}} call, which is going to be made per term
in a search query.
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:4>
* cc: goblinJoel (added)
Comment:
This is old, but I think it's a good idea. It's still a problem in Django
1.11, and I didn't see any changes in the 2.x code that looked relevant.
It can end up devouring storage space larger than the db itself and suck
up CPU to the point where the database system becomes unresponsive or runs
out of storage.
I'm not sure whether I should be making unilateral edits, so I suggest
renaming to something like:
**Multi-word admin searches hang with foreign keys in search_fields**
Related:
* https://github.com/django/django/pull/7277 with a similar solution
* https://groups.google.com/forum/#!topic/django-developers/V8M49P326dI
thread related to above PR
* https://code.djangoproject.com/ticket/27864 more recent attempt to
mitigate by limiting how many search terms you can use
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:6>
* owner: nobody => Jacob Walls
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:7>
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:8>
Comment (by Mariusz Felisiak):
#21241 was a duplicate, see for a related discussion.
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:9>
* needs_tests: 1 => 0
Comment:
[https://github.com/django/django/pull/15022 new PR]
[https://groups.google.com/g/django-developers/c/V8M49P326dI mailing list]
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:10>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"948d6d880500bc925e23fde29e0f7ff7cc52cac5" 948d6d88]:
{{{
#!CommitTicketReference repository=""
revision="948d6d880500bc925e23fde29e0f7ff7cc52cac5"
Refs #16063 -- Added tests for searching against multiple related fields
in admin changelist.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:11>
* needs_better_patch: 0 => 1
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:12>
* needs_better_patch: 1 => 0
* needs_docs: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:13>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:14>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"76ccce64cc3d66cfec075651c3d2239fda747dc2" 76ccce6]:
{{{
#!CommitTicketReference repository=""
revision="76ccce64cc3d66cfec075651c3d2239fda747dc2"
Fixed #16063 -- Adjusted admin changelist searches spanning multi-valued
relationships.
This reduces the likelihood of admin searches issuing queries with
excessive joins.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16063#comment:15>