我有一个问题,我可以在 SQL Sever 管理工作室中运行查询,但是当我从 Mybatis 运行它时,相同的查询挂起。活动监视器显示由查询启动的许多进程,这些进程似乎通过许多 cxpacket 和 pageiolatch_sh 等待相互计时。
audit_player 表有 2.67 亿行,player 和 playerInfo 350,000 和货币 20。
关于可能导致这种情况的任何想法?
select 'INS' as typeOfChange,
p.playerId as "model.id"
from Player p
INNER join
(select DISTINCT(playerId) as playerId
from Audit_Player
where modifiedDate > '2012-11-14 14:35:47' and action in ('INS', 'UPD') and tester = 0) ap
on p.playerId = ap.playerId
left outer join PlayerInfo i on i.playerId = p.playerId
left outer join Currency c on c.curName = i.curName where c.curCode <> 'XXX'
UNION
select 'DEL' as typeOfChange,
playerId as "model.id"
from Audit_Player
where modifiedDate > '2012-11-14 14:35:47' and action = 'DEL'