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

Snowflake低基数日期列排序耗时不均问题排查请求

问题:Snowflake排序阶段耗时异常及Query Profile准确性疑问

现象描述

  • 使用大型Warehouse执行建表操作,不同规格Warehouse下均出现同一问题:某查询中,Snowflake仅用10分钟完成1.8G行数据的排序,却耗时30分钟处理剩余0.2G行数据。
  • 待排序列为低基数日期列(日期范围2020-2025)。

核心疑问

  1. 该耗时异常现象是Snowflake特定排序算法导致,还是Warehouse节点执行不均的集群问题?
  2. Query Profile是否无法精准反映实际执行过程?

涉及查询语句

含UNION ALL的建表语句

create or replace table table_name as
select *, null as extra_column from table_name where column_2 is null
union all 
select *, column_3[0] as extra_column from table_name where column_2 is not null
order by datetime::date 

注:第一部分查询返回1.6G行,第二部分返回0.8G行;实际涉及多列数组提取,示例仅作简化。

移除UNION ALL后的建表语句(仍存在类似现象,程度较轻)

create or replace table table_name as
select *, null as extra_column from table_name where column_2 is null
order by datetime::date 

查询计划截图

Query Plan

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.13 00:14:54