You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SQL Server 2017简单查询执行过慢问题求助

SQL Server 2017查询性能骤降问题求助

我在SQL Server 2017环境下执行查询并查看统计信息时,遇到了性能异常问题:查询执行到某个阶段后速度变得极慢。此前我完成过更复杂的查询与关联操作,耗时最多仅数秒,但本次查询预计需要数小时才能完成。

执行的查询语句

drop table if exists #barcodestemp
select 
    suc.stock_code,
    suc.suc_unit_desc,
    case 
        when not exists (select * from nicholas.dbo.stock_unit_conversion suc2 where suc2.trade_unit_no = suc.trade_unit_no and suc2.stock_code != suc.stock_code)
        then 
            suc.trade_unit_no
        else 
            ''
        end as barcode
into
    #barcodestemp
from nicholas.dbo.stock_unit_conversion suc

补充信息

查询的执行计划已通过专业工具生成存储(原外链已移除)

内容的提问来源于stack exchange,提问作者nicholas8855

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 11:55:55