日期:2014-05-16  浏览次数:20991 次

mysql查询锁表了
select sum(fee) as Fee from ACCOUNT2.feecdr2 where (uid = any(select buid from ACCOUNT2.person where cid=1001) or uid=any(select muid from ACCOUNT2.person where cid=1001) or uid=123456789) and begintime>date_sub(now(),interval 56 DAY) and begintime<date_sub(now(),interval 25 DAY) and type=24


这个查询语句要查询半个小时都没查出来,锁表了。 各位老大帮忙看下,先谢了!

------解决方案--------------------
你先确认到底是表记录多,查询速度慢

还是其他语句把表锁住了
------解决方案--------------------
show processlists; 看一下哪些进程在运行和锁表。