高分求救,关于count语句的优化
现在有cust,serv两张表,现在必须要关联两张表进行count,数据量量张表都在50W左右,现在查询要6秒左右,有什么好的优化方法吗,sql语句如下:
select /*+ index_ffs(cust) */ count(distinct a.cust_no) as record_count From cust a, serv b
Where a.cust_type =1 And a.vip_type >=-1
And a.mature_grade >=1 And a.state <>'70X' and a.cust_id = b.cust_id And (a.organ_code like '%@@%' )