Django ORM will map this queryset
TestModel.objects.filter(module="test", deleted=False)
to this raw sql:
select coll1, coll2, coll3 from test_module where (TestModel.deleted=0 and TestModel.module="test")
No matter where you put the "deleted" in the filter paras, it takes the first place it the where clause.
My first guess is that Django put all bool/tinyint field before others, but test shows not. Seems Django just put the field named "deleted" in front of others. Quite odd, but why?
Because I am adding indexes to mysql tables, the order really matters.