page127
110
Stages
Both internal and external stages consume storage and contribute to costs:
•
Internal stages consume storage within the Snowflake VPC.
•
External stages consume storage on accessible CSP or S3 compatible
storage.
Storage costs accrue regardless of where storage is declared, and you should
consider stage storage costs to reduce your overall storage consumption costs.
Dropping an external stage does not automatically remove files stored within the
mapped location.
To identify active stages for your Snowflake account, you use the Account Usage
Store
STAGES
view. Note that a latency of up to two hours applies. Here you create a view
called
v_stage_locations
for ease of use.
CREATE OR REPLACE VIEW v_stage_locations
AS
SELECT stage_catalog||'.'||
stage_schema||'.'||
stage_name AS path_to_stage,
stage_url,
stage_owner
FROM snowflake.account_usage.stages
WHERE stage_owner IS NOT NULL
ORDER BY path_to_stage;
You might also use the equivalent
information_schema
view. Note the 14-day data
limitation and that each database has an
information_schema
; therefore, every database
would require separate investigation. You can find further information on
STAGES
at
https://docs.snowflake.com/en/sql-reference/account-usage/stages
.
With your stages identified and for internal stages only, you can identify the average
daily storage usage. The new view called
v_stage_avg_storage
provides summary
information.
ChaPTer 4
MiCro-ParTiTionS