SELECT t.* FROM (SELECT t1.USER_ID,t3.CUST_ID,t3.BILL_ID AS MSISDN,t3.CREATE_DATE AS ACTIVE_DATE,t1.ACCT_ID,t2.CUST_GROUP
FROM so1.ins_accrel_571 t1,so1.um_cm_account t2 ,so1.ins_user_571 t3 WHERE t1.ACCT_ID IN(
“207120810103” ) AND t1.ACCT_ID = t2.ACCT_ID AND t3.USER_ID = t1.USER_ID AND t3.USER_TYPE = “1” AND t3.BILL_ID IS NOT NULL AND t3.CUST_ID IS NOT NULL) t
WHERE t.USER_ID IN (
SELECT t5.USER_ID FROM so1.um_order_group t4,so1.um_order_group_member t5 WHERE t4.GROUP_ID = t5.GROUP_ID AND (t4.GROUP_TYPE = “2” OR t4.GROUP_TYPE = “3”) AND t5.MEMBER_ROLE = “0” AND t5.STATUS IN(1,2,5,6)
) AND t.USER_ID IN (
SELECT t6.`USER_ID` FROM so1.`ins_user_571` t6,so1.`ins_offer_571` t7
WHERE t6.`USER_ID` = t7.`USER_ID` AND t7.`OFFER_ID` != 20000032
);
现在的这个效率太低了 查询直接死机,尤其是加上最后两个in条件之后……跪求高手帮忙优化
FROM so1.ins_accrel_571 t1,so1.um_cm_account t2 ,so1.ins_user_571 t3 WHERE t1.ACCT_ID IN(
“207120810103” ) AND t1.ACCT_ID = t2.ACCT_ID AND t3.USER_ID = t1.USER_ID AND t3.USER_TYPE = “1” AND t3.BILL_ID IS NOT NULL AND t3.CUST_ID IS NOT NULL) t
WHERE t.USER_ID IN (
SELECT t5.USER_ID FROM so1.um_order_group t4,so1.um_order_group_member t5 WHERE t4.GROUP_ID = t5.GROUP_ID AND (t4.GROUP_TYPE = “2” OR t4.GROUP_TYPE = “3”) AND t5.MEMBER_ROLE = “0” AND t5.STATUS IN(1,2,5,6)
) AND t.USER_ID IN (
SELECT t6.`USER_ID` FROM so1.`ins_user_571` t6,so1.`ins_offer_571` t7
WHERE t6.`USER_ID` = t7.`USER_ID` AND t7.`OFFER_ID` != 20000032
);
现在的这个效率太低了 查询直接死机,尤其是加上最后两个in条件之后……跪求高手帮忙优化
解决方案
40