Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Warehouse Management

Warehouse Scheduling feature automates modification of Snowflake virtual warehouse properties according to custom daily schedules. Separate schedules can be set for weekdays (Monday through Friday) and weekends (Saturday and Sunday) for each warehouse. A schedule is composed of one or more periods, defined with a start_at and finish_at time, set at quarter-hour resolution (:00, :15, :30, :45).

The periods configured for a schedule must cover all of the 24 hours in a day (midnight to midnight) with no gaps, meaning that the start_at time for a period must be the same value as the finish_at time for the preceding period for that schedule (or midnight, if the period is the first defined for the schedule).

Warehouse schedules will be applied according to the configured timezone (available via “About” -> “Snowflake Settings” -> “Default Timezone”).

Any warehouse property can be modified by a Warehouse Schedule, including: warehouse size, number of minutes before auto-suspend, and auto-resume. For Snowflake Enterprise Edition and Business Critical Edition accounts, a Warehouse Schedule can also modify the auto-scaling policy for multi-cluster warehouses and the maximum number of autoscaled clusters.

After defining schedule for a warehouse, click the “Enable Scheduling” button to activate the schedule. For each enabled schedule, the warehouse’s properties will be updated on the schedule boundaries. Sundeck does not continuously inspect each warehouse’s configuration to determine if it has deviated from the properties set by the schedule. This means that any manual changes to warehouse configuration will persist until the next defined schedule period, when they will be set to the values defined by the schedule.

Listing available Warehouses

Click on the “Warehouse Schedules” navigation on the left side. You will will be presented with the list of all warehouses in your Snowflake account and their properties that include:

  • The current warehouse size (or “variable” if schedules are defined for that warehouse).
  • Autoscale, if this is a multi-cluster warehouse (Snowflake Enterprise Edition and above, only).
  • If the schedules are currently enabled for this warehouse.

Creating a Schedule

Warehouse schedules can be created, updated, or deleted using the Sundeck SaaS User Interface or by calling SQL stored procedures.

When creating a new schedule, the new schedule’s finish_at must match an existing schedule’s finish_at time. This can be modeled as splitting an existing schedule in half and defining the new configuration for the “latter” half. When deleting a schedule, the Sundeck Native App will fill any gaps to guarantee that the schedules remaining cover the 24hour period of a day.

DDL for Warehouse Schedules

Sundeck UI

  1. Click on the left side navigation menu “Warehouse Schedules”.
  2. Click on the warehouse row in the table you wish to create schedule for.
  3. Use “+” button to create a new period.
After creating a schedule, be sure to enable it with the “Enable Schedule” button.

Examples

Queueing during business hours

A team of developers in the marketing department share a single Snowflake warehouse MARKETING_WH. They share one warehouse to simplify cost attribution by their team. However, when all the developers are using Snowflake, they have noticed that their queries are getting queued before running because their shared warehouse is too busy running queries. To reduce queueing, they have increased the size of the MARKETING_WH to be Large, but now find that their costs are going to exceed their monthly budget. They planned for the increase in cost during normal business hours (9am to 5pm), but they are seeing that queries from outside of normal business hours significantly contribute to their team’s costs when there is no queueing problem.

The team can create a warehouse schedule which increases the size of MARKETING_WH to Large from 9am to 5pm on weekdays, and decreases the size of MARKETING_WH to X-Small during midnight to 9am and 5pm to midnight on weekdays and for all hours (midnight to midnight) on weekends. This gives the team the performance they need during business hours, but reduces cost from queries that run outside business hours.

MARKETING_WH Schedule

Time sensitive scheduled workloads

Consider a team who is responsible for producing a report and dashboard that summarizes the previous day’s sales data. This dashboard is built by bulk-loading a number of data sources from S3 into Snowflake, transforming the loaded data, and then joining it against a number of other data sources already in Snowflake. After their sales report is updated, other teams also have processing to perform before start of business the next day. To give adequate time for all processing, this team’s workload starts every day at 2am and needs to finish by 3am so other follow-on workloads can finish before 8am.

The team wants to increase the size of the warehouse to ensure this job finishes within 1 hour, but has struggled to maintain their budget after doing this. They have updated the job to increase the size of the warehouse before the job starts, but have had face challenges ensuring the warehouse is scaled back down after the job finishes, often relying on a team member to notice and manually resize the warehouse.

To solve this problem, the team can create a warehouse schedule which scales up the warehouse to ‘X-Large’ at 1:45am to ensure that the warehouse is ready for the job to start at 2am. Then, they can create a second schedules which resizes the warehouse down at 3 AM, long before any team member starts their work day, ensuring that no team member has to remember to check the warehouse size.

SALES Schedule