mysql - Will a binary operator used in group by prevent the use of an index for optimization? -


i.e. there index invoke_statistics.method

select max(`t0`.`method`) `d0`,   sum(`t0`.`success`) `m0` `invoke_statistics` `t0` group binary `t0`.`method` limit 20000 

will binary operator used in group by sentence prevent use of index optimization?

if yes, then, recommended way group by string field via strict string comparation instead of using binary, considering have no permission change table definition?

this bit long comment.

i don't understand query. why not write:

select binary t0.method d0, sum(t0.success) m0 invoke_statistics t0 group binary t0.method;  

the initial max() shouldn't doing (how can 2 values in column the same in binary representation different in representation?).

then, answer question, mysql take collation account when creating indexes -- has to, because collations define ordering. because binary changes collation, expect preclude index usage. not 100% certainty; expectation.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -