gpt4 book ai didi

snowflake-cloud-data-platform - Snowflake 是否跟踪仓库大小调整值?

转载 作者:行者123 更新时间:2023-12-04 13:06:02 31 4
gpt4 key购买 nike

我正在查看 WAREHOUSE_EVENTS_HISTORY,但找不到跟踪仓库大小调整值的方法。

如何从 Snowflake 中获取这些数据?

(基于客户问题)

最佳答案

要跟踪调整大小的值,您可以在 query_id 上加入 WAREHOUSE_EVENTS_HISTORYQUERY_HISTORY,并解析 sql_text:


use role accountadmin
;

select timestamp, event_state, a.user_name, a.role_name,
upper(regexp_substr(b.query_text, '(XSMALL|SMALL|MEDIUM|LARGE|XLARGE|XXLARGE|XXXLARGE|X4LARGE|X5LARGE|X6LARGE)', 1, 1, 'i')) as wh_size,
upper(regexp_substr(b.query_text, '(STANDARD|ECONOMY)', 1, 1, 'i')) as scaling_policy
from snowflake.account_usage.WAREHOUSE_EVENTS_HISTORY a
join snowflake.account_usage.QUERY_HISTORY b
on a.query_id = b.query_id
where a.event_name = 'ALTER_WAREHOUSE'
and a.timestamp > '2021-10-01'

enter image description here


如果您正在考虑分析成本,请检查:

关于snowflake-cloud-data-platform - Snowflake 是否跟踪仓库大小调整值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69459204/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com