OceanDB对于分组函数如SUM AVG的查询效率比mysql慢很多的原因,比如:SELECT CAST(AVG(NULLIF(station_temperature1, 0)) AS DECIMAL(19, 1)) AS station_temperature,
CAST(AVG(NULLIF(station_room_humidity1, 0)) AS DECIMAL(19, 1)) AS station_room_humidity,
CAST(AVG(NULLIF(gas_station_power1, 0)) AS DECIMAL(19, 1)) AS gas_station_power,
CAST(AVG(NULLIF(gas_station_flow1, 0)) AS DECIMAL(19, 1)) AS gas_station_flow,
CAST(AVG(NULLIF(gas_station_unit_energy1, 0)) AS DECIMAL(19, 4)) AS gas_station_unit_energy,
CAST(AVG(NULLIF(station_mother_pipe1_flow1, 0)) AS DECIMAL(19, 0)) AS station_mother_pipe1_flow,
CAST(AVG(NULLIF(station_mother_pipe1_pressure1, 0)) AS DECIMAL(19, 0)) AS station_mother_pipe1_pressure,
CAST(AVG(NULLIF(station_mother_pipe1_temperature1, 0)) AS DECIMAL(19, 0)) AS station_mother_pipe1_temperature,
CAST(AVG(NULLIF(station_mother_pipe1_dew_point1, 0)) AS DECIMAL(19, 0)) AS station_mother_pipe1_dew_point,
CAST(AVG(NULLIF(kyj_exhaust_pressure1, 0)) AS DECIMAL(19, 2)) AS kyj_exhaust_pressure,
CAST(AVG(NULLIF(kyj_exhaust_temperature1, 0)) AS DECIMAL(19, 0)) AS kyj_exhaust_temperature,
CAST(AVG(NULLIF(kyj_host_current_a1, 0)) AS DECIMAL(19, 1)) AS kyj_host_current_a,
CAST(AVG(NULLIF(kyj_host_current_b1, 0)) AS DECIMAL(19, 1)) AS kyj_host_current_b,
CAST(AVG(NULLIF(kyj_host_current_c1, 0)) AS DECIMAL(19, 1)) AS kyj_host_current_c,
CAST(AVG(NULLIF(kyj_host_output_frequency1, 0)) AS DECIMAL(19, 1)) AS kyj_host_output_frequency,
CAST(AVG(NULLIF(kyj_host_output_current1, 0)) AS DECIMAL(19, 1)) AS kyj_host_output_current,
CAST(AVG(NULLIF(kyj_engine_speed1, 0)) AS DECIMAL(19, 0)) AS kyj_engine_speed,
CAST(AVG(NULLIF(kyj_fan_speed1, 0)) AS DECIMAL(19, 0)) AS kyj_fan_speed,
CAST(AVG(NULLIF(kyj_injection_pressure*1, 0)) AS DECIMAL(19, 2)) AS kyj_injection_pressure,
CAST(AVG(NULLIF(kyj_system_temperature*1, 0)) AS DECIMAL(19, 0)) AS kyj_system_temperature,
CAST(AVG(NULLIF(kyj_host_current*1, 0)) AS DECIMAL(19, 0)) AS kyj_host_current,
CAST(AVG(NULLIF(kyj_winding_temperature1*1, 0)) AS DECIMAL(19, 0)) AS kyj_winding_temperature1,
CAST(AVG(NULLIF(kyj_winding_temperature2*1, 0)) AS DECIMAL(19, 0)) AS kyj_winding_temperature2,
CAST(AVG(NULLIF(kyj_inlet_water_temperature*1, 0)) AS DECIMAL(19, 0)) AS kyj_inlet_water_temperature,
CAST(AVG(NULLIF(kyj_outlet_water_temperature*1, 0)) AS DECIMAL(19, 0)) AS kyj_outlet_water_temperature,
CAST(AVG(NULLIF(kyj_primary_exhaust_temperature*1, 0)) AS DECIMAL(19, 0)) AS kyj_primary_exhaust_temperature,
CAST(AVG(NULLIF(kyj_injected_temperature*1, 0)) AS DECIMAL(19, 0)) AS kyj_injected_temperature,
CAST(AVG(NULLIF(kyj_first_stage_exhaust_pressure*1, 0)) AS DECIMAL(19, 2)) AS kyj_first_stage_exhaust_pressure,
CAST(AVG(NULLIF(kyj_inlet_pressure*1, 0)) AS DECIMAL(19, 2)) AS kyj_inlet_pressure,
CAST(AVG(NULLIF(kyj_host_frequency*1, 0)) AS DECIMAL(19, 0)) AS kyj_host_frequency,
CAST(AVG(NULLIF(kyj_fan_frequency*1, 0)) AS DECIMAL(19, 0)) AS kyj_fan_frequency,
CAST(AVG(NULLIF(lgj_dew_point_temperature*1, 0)) AS DECIMAL(19, 0)) AS lgj_dew_point_temperature,
CAST(AVG(NULLIF(lgj_inlet_temperature*1, 0)) AS DECIMAL(19, 0)) AS lgj_inlet_temperature,
CAST(AVG(NULLIF(lgj_condensing_temperature*1, 0)) AS DECIMAL(19, 0)) AS lgj_condensing_temperature,
CAST(AVG(NULLIF(lgj_outlet_temperature*1, 0)) AS DECIMAL(19, 0)) AS lgj_outlet_temperature,
CAST(AVG(NULLIF(lgj_evaporation_temperature*1, 0)) AS DECIMAL(19, 0)) AS lgj_evaporation_temperature,
CAST(AVG(NULLIF(xgj_inlet_temperature*1, 0)) AS DECIMAL(19, 0)) AS xgj_inlet_temperature,
CAST(AVG(NULLIF(xgj_output_temperature*1, 0)) AS DECIMAL(19, 0)) AS xgj_output_temperature,
CAST(AVG(NULLIF(xgj_outlet_pressure*1, 0)) AS DECIMAL(19, 3)) AS xgj_outlet_pressure,
CAST(AVG(NULLIF(xgj_dew_point_temperature*1, 0)) AS DECIMAL(19, 0)) AS xgj_dew_point_temperature,
CAST(AVG(NULLIF(glj_ab_phase_voltage*1, 0)) AS DECIMAL(19, 1)) AS glj_ab_phase_voltage,
CAST(AVG(NULLIF(glj_ca_phase_voltage*1, 0)) AS DECIMAL(19, 1)) AS glj_ca_phase_voltage,
FROM device_coll_param_statistics
WHERE coll_time BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND CURDATE() /+ordered/ hint