有个查询语句
select msisdn,'1006000001','11' from gsm_user_nt a where to_char(a.apply_date,'yyyymm')<='200507' and brand_id=1 and state>=1 and state<=19  
and  exists  (select 1 from custcare.user_product_info_nt@TO_ZWDB11_WX b where a.gsm_user_id=to_char(b.user_id) and product_id in(100000,100004,100002,100006) and end_date is null)  
and not exists 
(select 1 from user_package_nt@TO_ZWDB11_WX c 
where a.gsm_user_id=to_char(c.user_id) and (package_code=1801 
and end_date is null ) or ( package_code=1983 and end_date is null )  or ( package_code in (2686,2687,2688,2689,2759,4525,4625,4521,4624,1205,1208,1209,1184,4516,4894) and end_date is null ))需要70秒左右(查询到的数据为0条)但是我在查询里,加了sequense,查询长时间出不来了。cm_credit_user_seq.nextval
select msisdn,'1006000001','11',cm_credit_user_seq.nextval from gsm_user_nt a where to_char(a.apply_date,'yyyymm')<='200507' and brand_id=1 and state>=1 and state<=19  
and  exists  (select 1 from custcare.user_product_info_nt@TO_ZWDB11_WX b where a.gsm_user_id=to_char(b.user_id) and product_id in(100000,100004,100002,100006) and end_date is null)  
and not exists 
(select 1 from user_package_nt@TO_ZWDB11_WX c 
where a.gsm_user_id=to_char(c.user_id) and (package_code=1801 
and end_date is null ) or ( package_code=1983 and end_date is null )  or ( package_code in (2686,2687,2688,2689,2759,4525,4625,4521,4624,1205,1208,1209,1184,4516,4894) and end_date is null ))