You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set @@session.tidb_allow_batch_cop=1; # 合并对 TiFlash 的数据请求
set @@session.tidb_opt_broadcast_join=1; # 开启 broadcast join 优化,
explain analyze
select
max(`name`) as name,
value,
max(hopIpValue) as hopIpValue,
max(hop_type) as hopType,
case when max(`group1`)='' then '未知' else max(`group1`) end as `group`,
# arrayStringConcat(groupUniqArray(active_state_unit),',') as protocol,
case when (max(t3.`group1`)='' and value not like '%_*' and value !='*') then 0 else 1 end as status,
max(`deviceType`) as deviceType,
min(hop) as minHop,
max(endTime) as endTime
from (
SELECT /*+ broadcast_join(t1, t2), broadcast_join_local(t1) */
t1.hop_ip as `name`,
t1.hop as `hop`,
hop_ip_int as `hopIpValue`,
t1.hop_ip as value,
case when t1.hop_ip=t1.ip then 1 else 0 end as hop_type,
t1.active_state_unit as active_state_unit,
t1.hop_ip_bizgroup as `group1`,
t1.device_type as `deviceType`,
t1.end_time as endTime
from vnap_data.active_trace_topology_gz as t1
INNER JOIN (
SELECT task_id, max(hop) as hop
from vnap_data.active_trace_topology_gz
WHERE end_time >1591080948
group by task_id
) as t2
on t1.task_id = t2.task_id
WHERE end_time >1591080948 and t1.hop<=30 and t1.hop >0 and (t1.hop_ip!=t1.ip) and t1.hop_ip!=t1.src_ip
) as t3
group by value
order by hopIpValue asc;
explain.xlsx
The text was updated successfully, but these errors were encountered: