select id,firstname,lastname,email,country,portal,language
from totaluser
where userid in
(select user from (select user, shipping / NULLIF(goodsvalue,0) as difference
from shipment
where user in
(select user
from (select user, count(*) as shipcount
from shipment
where user in
(select user from shipment
where status in ('3','5')
and createdtime between '2012-01-01'
and '2013-02-22' group by user)
and status in ('3','5') group by user)
as a
where status in ('3','5')
and shipcount=1))
as b
where difference > 2.5);
我知道这是一个非常简单的语句,它可以立即在我的测试服务器中运行,但是在我的生产服务器中运行需要很长时间。我应该如何改变它以加快速度?