我有以下更新语句,它运行了几次并且非常慢(20 多秒)。关于如何提高其性能的任何建议?
update acc_item
set means_pay_no = m_pay_no
where acc_item_no in (select distinct(acc.acc_item_no)
from acc_item acc, (select accm.acc_item_no acc1,accm.acc_item_no_2 acc2
from acc_item_match accm,acc_payment_item accp
where accp.acc_payment_no=pay_no
and (accm.acc_item_no = accp.acc_item_no or accm.acc_item_no_2 = accp.acc_item_no))
where acc.acc_item_no = acc1
or acc.acc_item_no = acc2)
and reversed_to_acc_item_no is null;