Automated Snowflake Warehouse Optimization with Revefi’s AI Data Engineer

Enterprise Data
Article
Mar 3, 2025
|
Abhimanyu Gupta
Rushikesh Kulkarni

Understanding Snowflake warehouse optimization challenges

If not properly managed, Snowflake’s high-performance and robust architecture can inadvertently drive up costs. With its pay-as-you-go pricing structure, Snowflake’s users and enterprise clients are billed based on compute, storage and data transfer consumption.

Snowflake warehouse optimization challenges
Figure 1: Source: Snowflake

Its virtual warehouse system, which dynamically scales to meet workload demands, offers a type of flexibility that is unparalleled. However, while employing the standard SQL methodology for ease of use, inefficient queries can quickly lead to excessive resource consumption and unexpected compute costs.

Simply put, Snowflake’s architecture requires a well-thought-out strategy for optimizing queries and managing resources effectively to offer effortless scalability and exceptional performance.

Snowflake warehouse architecture

Having a good understanding of Warehouse Sizes, Cluster Dynamics, Auto-Suspend, and Concurrency is critical to having a high performing Snowflake deployment. Hence, it's essential to understand key configuration aspects like:

  • Warehouse Size (Vertical Scaling): Defines compute capacity, measured in T-shirt sizes.
  • Cluster Size (Horizontal Scaling): Determines the number of compute nodes, adjusting dynamically to workload demands.
  • Auto-Suspend Timeout: Reduces costs by suspending inactive warehouses while retaining caching advantages.
  • MAX_CONCURRENCY_LEVEL: Manages concurrent SQL execution, optimizing resource distribution without underutilization.

Snowflake warehouse architecture
Figure 2: Snowflake Architecture

Fine-tuning these settings enhances efficiency, ensuring an optimized and cost-effective Snowflake warehouse environment.

Contributing factors behind Snowflake's warehouse cost and performance issues

Queueing in Snowflake presents a complex trade-off between performance and cost. Users often complain about slow query performance, unnecessary resource consumption, and increased storage expenses.

While excessive queueing implies that the warehouse is underprovisioned, some queueing is not bad as it helps absorb spiky workloads and leads to better utilization of underlying compute resources.

Snowflake Warehouse Size & Scaling

Snowflake's users are responsible for determining the appropriate warehouse size for their workloads, a process that can be challenging. Larger warehouses (e.g., XL or 2XL) consume more compute credits per second than smaller ones (e.g., XS).

When a query is submitted to a warehouse that is already running, the said query is executed. If the warehouse is not active, submitting a query triggers the spin-up of new compute resources. If warehouses are not properly configured, unnecessary scale-ups due to auto-scaling can unintentionally increase costs.

Snowflake Warehouse Size
Figure 3: Source: Snowflake

Manual Controlling of Snowflake Warehouse Configurations

Snowflake’s adaptable design enables users to set up virtual warehouses, ensuring dedicated compute power for query processing. Choosing the right warehouse size for specific workloads can be complex and requires careful consideration.

If a query is sent to an active warehouse, it executes immediately using the existing resources. However, if the warehouse is idle, Snowflake automatically starts new compute resources upon query submission. This process introduces startup delays and may lead to over-provisioning when dealing with smaller queries.

Disk Spills: Longer Runs Translates into Higher Costs

Contrary to popular belief, in Snowflake, slower queries do not equate to lower costs. When a query's processing demands exceed the available memory in the virtual warehouse, the data spills into the disk.

Disk spills, especially remote ones, drastically increase query execution time. Understanding the factors that contribute to spills, such as complex queries, under-provisioned warehouses, or massive datasets, is needed for optimizing query performance.

Resource Contention and Performance Optimization with Mixed Workloads

Running a diverse mix of queries concurrently on the same Snowflake warehouse presents a challenge. Snowflake's architecture allows Data Query Language (DQL) and Data Manipulation Language (DML) statements (such as SELECT and COPY INTO) to execute in parallel in the same warehouse.

This complexity is further compounded by the widely varying execution times of different queries. Some queries might be completed in seconds, while others, particularly those involving large datasets or complex transformations, can run for hours. Managing this mix of short and long-running queries, each with its own resource demands can make it difficult to predict and optimize performance.

Dynamic Scaling and Optimization of Snowflake Compute using Revefi

Maximizing Snowflake warehouse performance involves managing numerous complex configurations. Even when users grasp these settings, they often set them up once based on peak demand and seldom adjust them. This static approach leads to inefficiencies, and as business requirements shift, performance naturally declines.

Revefi’s AI Data Engineer delivers continuous optimization and proactive management, keeping warehouses finely tuned for optimal efficiency. Through round-the-clock monitoring and intelligent automation, Revefi effectively addresses these challenges with two strategic solutions:

  1. Continuous Optimization: Revefi uses machine learning and AI to analyze historical and real-time metadata, proactively identifying opportunities for improvement. Revefi’s sophisticated Snowflake simulator simulates concurrent query execution scenarios. This allows the platform to determine optimal queueing strategies and right-size warehouses and clusters, minimizing wasted compute resources while maximizing performance and reducing execution time.
  2. Dynamic Resource Management: Revefi actively monitors running queries while tracking metrics like queueing time, execution time, and cost. If these metrics deviate from the optimal performance profiles identified by Revefi'sML/AI models, the platform dynamically adjusts warehouse and cluster sizes. This ensures consistent performance and prevents cost overruns, even with fluctuating workloads.

Take back control of your Snowflake Warehouse with Revefi

Effectively managing Snowflake requires ongoing optimization, yet most organizations configure their warehouses once and leave them static, leading to inefficiencies over time. The figure below shows how Revefi automated data warehouse optimization helped reduce Snowflake credits used by 50%.

 Snowflake credits usфпу
Figure 4: 50% reduction in Snowflake spend

Revefi’s AI Data Engineer provides a smarter approach through continuous optimization. By analyzing historical and real-time data to right-size resources and improve query execution, it proactively adjusts warehouse and cluster sizes based on workload demands. By automating these critical processes, Revefi prevents cost overruns while maintaining efficiency.

warehouse performance report
Figure 5: Warehouse Performance Optimization Report

Want to learn more about us, and how we’re automatically solving Data Warehouse Management problems for organizations across the globe? Visit our official website.

You can also get in touch with our in-house experts to find out how we can help you better.

Article written by
Abhimanyu Gupta
MTS @ Revefi
Article written by
Rushikesh Kulkarni
Software Engineer @ Revefi
Table of Contents
Experience the AI Data Engineer
Get started for free