DB2 如何提高查询性能
在页面当中有很多计count这样的语句,而且table数据量很大
select count(1) from table where JD not like 'NR/%' and JDNUM="+result.getString("NUM");
select count(1) from table where JDJOBC like 'NR/%' and JDNUM="+result.getString("NUM");
select count(1) from table t
where t.JDJOBC like 'NR/%' and (t.JDJETA!='Y' and t.JDJETA!='C') and t.JDNUM="+result.getString("NUM")
怎么做可以提高查询速度
我的想法是
把所有的COUNT写成一条语句,
因为都是在table中根据不同的条件计不同的count,DB2中有ORCALE中类似decode的函数吗