注册

执行过慢

DM_919317 2021/10/27 1251 6

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM8
【操作系统】:WINDOWS10
【CPU】: intel
【问题描述】*:

  • 在达梦中执行select语句速度需要11s左右,但在mysql中执行仅需1.5s左右;
  • 表索引已同步至达梦表中
  • 表量级在320w左右

具体信息

sql语句

SELECT "area_code" as "area_code", "occur_period_year" as "year", "occur_period_month" as "month", "index_value" as "value", "unit_use" as "unit", "index_code" as "index_code", "dim_cal" as "dim_cal" FROM "macro_index_data" WHERE "index_code" = 'gmjj_jjzl_01' AND "dim_cal" = 'JDZ' AND "dim_dur" = 'DNLJ' AND ("dim_extra" = '' or "dim_extra" is null) AND "occur_period_month" IN(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) AND "area_code" IN('440300000000') ORDER BY "occur_period_year" desc, "occur_period_month" desc

执行计划
微信图片_20211027153121.png
索引信息
微信图片_20211027153232.png
请问该如何优化呢?最好是能从数据库方面下手,改动sql语句需要其它同事参与,会耗时较久[苦涩]

回答 0
暂无回答
扫一扫
联系客服