Mysql optimization

82 4

is MySQL.
select
Min ( wc_value as decimal ( 50, 5 ) ) wn_min,
Max ( wc_value as decimal ( 50, 5 ) ) wn_max,
Avg ( wc_value as decimal ( 50, 5 ) ) wn_avg
From bak_water_current where wc_datatime>?
And wc_datatime <=? and wc_mn => 32060032020001 '
Group by wc_pollutant_code
Having wc_pollutant_code => 011 '

I've added an index to datatime and wc mn, and would you like to add an index to the wc pollutant code.

1 Answers

70 5

Why don't I tell you to explain that the plan is executed? Optimize, optimize, don't use eyes, to get the data to speak.

...