注册

简单的SQL语句查询很慢

DM_553227 2025/04/27 149 4

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM8
【操作系统】:Kylin Linux Advanced Server V10 (Lance)
【CPU】: 32核
【问题描述】*:
备注:
a. 已收集过表信息
b. 系统信息(虚拟机)
image.png
image.png
c. 部分系统参数
image.png

  1. 这是我的查询 SQL:
    select a.tx_dt
    ,a.investor_id
    ,a.agmt_cd
    ,a.hedge_flg
    ,sum(a.count) bargain_count
    from dc$investor_close_detail a
    where a.openclose_flg <> '0'
    group by a.tx_dt
    ,a.investor_id
    ,a.agmt_cd
    ,a.hedge_flg;

  2. dc$investor_close_detail 该表是从 oracle 中迁移过来的,总量为192572697条,表结构如下:
    image.png

  3. 同样的语句跟表结构,达梦 跟 Oracle 相差比较大
    达梦约:3分钟不到
    image.png
    Oralce约: 37s
    image.png

请问为何同样的表结构、数据,执行起来为何这么慢?有什么地方可以进行优化么?

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