OceanDB对于分组函数如SUM AVG的查询效率比mysql慢很多的原因

OceanDB对于分组函数如SUM AVG的查询效率比mysql慢很多的原因,比如:SELECT CAST(AVG(NULLIF(station_temperature1, 0)) AS DECIMAL(19, 1)) AS station_temperature,
CAST(AVG(NULLIF(station_room_humidity
1, 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_flow
1, 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_flow
1, 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_temperature
1, 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_pressure
1, 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_a
1, 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_c
1, 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_current
1, 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_speed
1, 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
  1. 登录业务租户,获取 sql 的执行计划
    EXPLAIN EXTENDED sql语句;–保存在文本里

  2. 再次执行需要采集的 sql 语句; --绑定hint /*+monitor */

  3. 获取上一步执行的 sql 的 trace_id 信息
    select last_trace_id();

  4. obdiag sql性能收集
    obdiag gather scene run --scene=observer.perf_sql --env “{db_connect=’-hxx -Pxx -uxx -pxx -Dxx’, trace_id=‘xx’}”
    obdiag安装
    https://www.oceanbase.com/docs/common-obdiag-cn-1000000001768268

您说的是商用版吗?请问我这个是社区版要怎么查询执行慢的问题,还有针对这方面有从集群方面调优方式吗

这个就是针对社区版的 按照这个收集信息 贴出来