Snowflake低基数日期列排序耗时不均问题排查请求
问题:Snowflake排序阶段耗时异常及Query Profile准确性疑问
现象描述
- 使用大型Warehouse执行建表操作,不同规格Warehouse下均出现同一问题:某查询中,Snowflake仅用10分钟完成1.8G行数据的排序,却耗时30分钟处理剩余0.2G行数据。
- 待排序列为低基数日期列(日期范围2020-2025)。
核心疑问
- 该耗时异常现象是Snowflake特定排序算法导致,还是Warehouse节点执行不均的集群问题?
- 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
查询计划截图

内容的提问来源于stack exchange,提问作者user304584
相关产品推荐
相关产品推荐

