Snowflake credit 計費方式

abehsu
ㄚ北的所見所聞
5 min readMay 12, 2019
Trial版本的Snowflake只有在你使用Virtual Warehouse的時候才會開始計費,在試用版階段,data storage不會被計費

Virtual warehouse 計費資訊

snowflake的計費方式是以秒計費,如果在60秒內會以一分鐘計算,但超過一分鐘後就是以秒計算

查詢Account用了多少Credit

只有你的帳號Role是 ACCOUNTADMIN 才可以查詢
  • 透過Web (Account->Usage)
  • 透過SQL
select *
from table(information_schema.warehouse_metering_history(dateadd('days',-10,current_date())));

DataStorage的計費方式 (link)

每個月根據用戶每日存儲數據的平均去做計費,並且根據帳戶類型、地區收費方式會不同,以TB計價
  • 透過Web (Account->Usage)
  • 透過SQL(Viewing Data Usage for Your Account)
select *
from table(information_schema.database_storage_usage_history(dateadd('days',-10,current_date()),current_date()));
select *
from table(information_schema.stage_storage_usage_history(dateadd('days',-10,current_date()),current_date()));
  • 透過SQL(Viewing Data Usage for a Table)
show tables like '%emp%' in sfe_tuts.public;show tables history in sfe_tuts.public;select * from information_schema.TABLE_STORAGE_METRICS;
注意事項:1.用SQL所顯示Table的bytes資訊,會在如果有query是掃整張Table的時候更新,所以所顯示的資訊有可能會和實際儲存的檔案大小有落差2.Clone的Table不會利用到額外的儲存空間,除非有新的Row增加,或是Update或delete的情況發生,所以有可能顯示的Table資訊會大於實際的physical bytes3.在Table中被刪除的資料不會顯示在Table的資訊中,被刪除的資料會被儲存在Snowflake中直到Travel retetion的時間到期,所以在這段期間內,Table所顯示的檔案大小有可能小於實際的存儲大小

學習到的單字

  • contractual (adj) 契約的
  • obligation (n) 責任;義務
  • unprecedented (adj) 史無前例的
  • accommodate (v) 使相符
  • resume (v) 重新開始;繼續

Reference

--

--

abehsu
ㄚ北的所見所聞

喜歡探索不同領域的人事物,喜歡將自己學習到的也分享給大家,並產生共同的討論,從中得到回饋。 Linkedln(https://www.linkedin.com/in/hsuyuming/)