1、把IN语法改成EXISTS and bu.BUSINESS_CODE in (select bus.businid from BASEDICTIONARY bus where bus.BUSINTYPEID='BUSINESS_CODE' and bus.PRIVILEGE=220)and exists select 1 from BASEDICTIONARY bus where bu.BUSINESS_CODE=bus.businid and bus.BUSINTYPEID='BUSINESS_CODE' and bus.PRIVILEGE=2202、用了LEFT JOIN 和 GROUP BY 试着把联立条件建立对应的索引试试。
或者查看一下,执行计划时候使用了索引
and bu.BUSINESS_CODE in (select bus.businid from BASEDICTIONARY bus where bus.BUSINTYPEID='BUSINESS_CODE'
and bus.PRIVILEGE=220)and exists select 1 from BASEDICTIONARY bus
where bu.BUSINESS_CODE=bus.businid
and bus.BUSINTYPEID='BUSINESS_CODE'
and bus.PRIVILEGE=2202、用了LEFT JOIN 和 GROUP BY
试着把联立条件建立对应的索引试试。