performance - Which mysql system variable affects group by clause? -


i applying group on dynamic fields mysql system variable increases speed?

for example: tmp_table_size or max_heap_table_size or other...

my table size 700 mb , explain gives me "using index condition; using temporary; using filesort"

my query following:

    select        if(         flag in ('a', 'b')          'featured',         'normal'       ) package,       if(         flag2 = 'a',         'group1',         'group2'       ) group_num,       count(*) total            mytable     publish = 1        , status in ('on', 'deleted', 'expired',)      group customized_flag,       agency_package_status ; 

the thing might speed query is

index(publish, status) -- in order. 

that possibly filter down small subset of 700mb.

your group by broken -- 'unpredictable' values group_num in output since not appear dependent on either customized_flag or agency_package_status.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -