#36492: Sqlite: lack of specificity when querying against booleans hurts the
query-
optimizer
-------------------------------------+-------------------------------------
Reporter: Klaas van Schelven | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):
* resolution: => fixed
* status: assigned => closed
Comment:
In [changeset:"4bbc27c8686f10f9556cef02dbfa9f5157fbcf56" 4bbc27c]:
{{{#!CommitTicketReference repository=""
revision="4bbc27c8686f10f9556cef02dbfa9f5157fbcf56"
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.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36492#comment:6>
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/0107019e8f46ce62-ecf6fa9c-1b95-46d8-a1ca-9e13de47c56e-000000%40eu-central-1.amazonses.com.