#32691: Performance regression in Exact lookup on BooleanField on MySQL.
-------------------------------------+-------------------------------------
Reporter: Todor Velichkov | Owner: Roman
Type: | Miroshnychenko
Cleanup/optimization | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: bool, booleanfield, | Triage Stage: Ready for
orm, sql, mysql | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):
In [changeset:"ecc5182234546e712207a60a6109f70a9068a588" ecc51822]:
{{{#!CommitTicketReference repository=""
revision="ecc5182234546e712207a60a6109f70a9068a588"
[6.1.x] Fixed #36492 -- Restored exact boolean lookup against literals on
SQLite.
Performance regression in 37e6c5b on SQLite. Just like MySQL, and
presumably
Oracle, which don't have a native boolean type and incidently store
booleans in
integer columns, indices on such columns cannot be used when explicit
boolean
literal equalities are omitted.
Adapt the logic introduced by refs #32691 for MySQL to be used for all
backends
that don't support native boolean fields instead of special casing MySQL,
SQLite, and Oracle in their own special way.
Note that review of this work surfaced that SQLite's query planner also
cannot
make use of indices when dealing with expressions of form
WHERE NOT (indexed_bool_field = false)
but that's a long standing problem unrelated to the restorative work
performed
in this patch.
Thanks Klaas van Schelven for the report.
Backport of 4bbc27c8686f10f9556cef02dbfa9f5157fbcf56 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32691#comment:21>
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 visit
https://groups.google.com/d/msgid/django-updates/0107019e8f4818c2-7ecb10ce-bd29-46df-84e9-14a5dc2bc5bb-000000%40eu-central-1.amazonses.com.