SQL执行效率怎么这么低
update AA set gldescription =
(select max(RateDescription) from BB
where trim(msifilesiteid) = AA.msifilesiteid and
Trim(ratecode) = AA.GLCode and
length(trim(ratecode)) > 3)
where (glcode is not null or glcode <> '') and glDescription is null;
这是一个存储过程的一部分,每天执行,其它的部分执行都很快,但到了这里就好半天才过去,AA数据量大概每天有3000条记录,BB表中大概有300000条记录, 每天增加。
不知道我的SQL到底哪里有问题,执行实在是太慢了,大家帮忙看看,谢谢!!