I've run into something I can't explain and I hope Snowflake support can help here...
The documentation for INFORMATION_SCHEMA views says there is no latency to display data in these views. https://docs.snowflake.com/en/sql-reference/account-usage.html#differences-between-account-usage-and-information-schema
However, storage allocation data is not available right away in this view - INFORMATION_SCHEMA.TABLE_STORAGE_METRICS.
I did some testing and I see it takes ~1-1.5 hrs to populate the view with storage info after my table was created, specifically, these columns - "active_bytes", "time_travel_bytes".
is this expected behavior for this view to display storage allocation data with latency ? or not ? where is the issue - documentation or snowflake views ?
here is a short description of my testcase
- table TEST_TABLE created under TEST database, PUBLIC schema ("normal" table, not transient, time travel retention parameter is set to 10 days)
- table populated with data, "TABLES" view shows its not empty - ~7.5 MB in there with ~130K rows
- switched to ACCOUNTADMIN role to have right access to required schema
- checked table INFORMATION_SCHEMA.TABLE_STORAGE_METRICS - "active_bytes", "time_travel_bytes" columns for the test table show zeros
- re-checked the view a few times - in ~1hr storage info showed up in these columns "active_bytes", "time_travel_bytes".
executed commands to query the views-
use role ACCOUNTADMIN;
select table_catalog, table_schema, table_name, table_type, is_transient, row_count, bytes, retention_time from test.information_schema.tables where table_name = 'TEST_TABLE';
select table_catalog, table_schema, table_name, is_transient, active_bytes, time_travel_bytes from test.information_schema.table_storage_metrics where table_name = 'TEST_TABLE';