注册

优化问题

JHSONN 2024/12/10 312 4 已解决

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:1-2-174-2022.11.21-175072-20024-SEC
【操作系统】:
【CPU】:
【问题描述】
以下语句执行大概要1s左右,执行次数在几千次,请问该怎么优化,提升执行效率?
select count(
)
from ( (select pk_trade_union
from trade_union
where higher_union_uuid in (select pk_trade_union
from trade_union
where higher_union_uuid = '8a4082d95c42ae81015c42b3db330005'
union all
select pk_trade_union
from trade_union
where higher_union_uuid in ('8a4082d95c42ae81015c42b3db330005')
and data_status = 0
and union_status = 0
and trade_union_type = 2
union all
select pk_trade_union
from trade_union
where higher_union_uuid in (select pk_trade_union
from trade_union
where higher_union_uuid in ('8a4082d95c42ae81015c42b3db330005'))
and data_status = 0
and union_status = 0
and trade_union_type = 2
union all
select pk_trade_union
from trade_union
where higher_union_uuid in (select pk_trade_union
from trade_union
where higher_union_uuid in (select pk_trade_union
from trade_union
where higher_union_uuid in ('8a4082d95c42ae81015c42b3db330005')))
and data_status = 0
and union_status = 0
and trade_union_type = 2)
and data_status = 0
and union_status = 0
and trade_union_type != 2) t
inner join member_basic_situation s
on s.pk_trade_union = t.pk_trade_union)
where s.data_status = 0;

image.png

回答 0
暂无回答
扫一扫
联系客服