snowflake-cloud-data-platformautoscalingwarehouse

How does warehouse size change automatically in Snowflake?


I have a small warehouse in SnowFlake, with minimum clusters = 1, maximum clusters = 5 and scaling policy set to standard. However, when I was viewing the query history profile, I saw that for some of the queries, size column was set to large, but the cluster number remained 1.

Now, I know that autoscaling helps increasing number of clusters, but how did the warehouse size change for some queries without manual intervention?

I referred to the official documentation of SnowFlake here, but couldn't find any ways to automatically change size of warehouse.


Solution

  • Snowflake does not carry any feature that will automatically alter the size of your warehouse.

    It is likely that the tools in use (or users) may have run an ALTER WAREHOUSE SET WAREHOUSE_SIZE=LARGE. The purpose may have been to prepare for a larger operation, ensuring adequate performance temporarily.

    Use the various history views to find out who/what and when such a change was run. For example, the QUERY_HISTORY view could be useful in finding the username and role that was used to alter the warehouse size, with the following query:

    SELECT DISTINCT user_name, role_name, query_text, session_id, start_time
    FROM snowflake.account_usage.query_history
    WHERE query_text ILIKE 'ALTER%SET%WAREHOUSE_SIZE%=%LARGE%'
    AND start_time > CURRENT_TIMESTAMP() - INTERVAL '7 days';
    

    Then you could use LOGIN_HISTORY view to find which IP the user authenticated from during the time (or use the history UI for precise client information), check all other queries executed in the same session, etc.

    To prevent unauthorized users from modifying warehouse sizes, consider restricting warehouse-level grants on their roles (rolename in use can be detected by the query above).