#32691: Django 3.2 boolean field SQL output is causing a performance regression 
in
mysql.
-------------------------------------+-------------------------------------
               Reporter:  Todor      |          Owner:  nobody
  Velichkov                          |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  3.2
  layer (models, ORM)                |       Keywords:  bool, booleanfield,
               Severity:  Normal     |  orm, sql, mysql
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When filtering on boolean field in Django 2.2 the SQL output would look
 like this:
 {{{
     WHERE `mytable`.`myfield` = 1
 }}}

 in Django 3.2 the SQL changed to:
 {{{
     WHERE `mytable`.`myfield`
 }}}

 The problem with the 2nd approach is that in mysql8 this field is not used
 in indexes anymore, causing a great performance degradation.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32691>
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/057.20e3c4c1805139afbc7cc64438270337%40djangoproject.com.

Reply via email to