要查看过去几天平均每天使用的字节数,可以使用stage_storage_usage_history:
select *
from table(information_schema.stage_storage_usage_history(dateadd('days',-10,current_date()), current_date()));
如果您想查看阶段和数据库的详细信息:
select convert_timezone('UTC', usage_date) as usage_date
, database_name as object_name
, 'database' as object_type
, max(AVERAGE_DATABASE_BYTES) as database_bytes
, max(AVERAGE_FAILSAFE_BYTES) as failsafe_bytes
, 0 as stage_bytes
from snowflake.account_usage.database_storage_usage_history
where usage_date >= date_trunc('day', ('2021-12-01')::timestamp_ntz)
and usage_date < date_trunc('day', ('2021-12-05')::timestamp_ntz)
group by 1, 2, 3
union all select convert_timezone('UTC', usage_date) as usage_date
, 'Stages' as object_name
, 'stage' as object_type
, 0 as database_bytes
, 0 as failsafe_bytes
, max(AVERAGE_STAGE_BYTES) as stage_bytes
from snowflake.account_usage.stage_storage_usage_history
where usage_date >= date_trunc('day', ('2021-12-01')::timestamp_ntz)
and usage_date < date_trunc('day', ('2021-12-05')::timestamp_ntz)
group by 1, 2, 3;
正如 Greg 在评论中所说,您可以使用取决于您的帐户合同细节的公式将这些月平均字节数转换为积分。