Virtual Warehouse – Basics to Advanced (Part 2)

In the Previous article, we saw the details of Virtual warehouse and their sizes. In simple word, consider a virtual warehouse as a compute machine and imagine the size scaling from extra small to 6x Large like increase in the compute(like memory, power etc.).

Virtual Warehouse Credit usage and billing

Snowflake employs billing on a per-second basis, with a minimum charge of 60 seconds whenever the warehouse is initiated. This ensures that warehouses are only billed for the credits they use.

Virtual Warehouse

Virtual Warehouse Credits and Billing (Ref Snowflake Website)

Virtual Warehouse Usage and Scaling

Now we can actually make use of virtual warehouse in 2 ways.

  1. If the query is processing larger amounts of data with complex logic, we can go for larger virtual warehouse.( Not always !!! 🙂 ) We call it as Scale up and Scale down. We can always resize the warehouse as per the amount of data being processed and complexity of query.
  2. If there are many queries submitted to a virtual warehouse, the no of queries a warehouse can process concurrently is determined by the size of the warehouse, complexity of query and no of clusters of warehouse.

When queries are initiated, the warehouse assesses and allocates the necessary compute resources for processing each query. If the warehouse lacks adequate resources to handle a query, the query is placed in a queue until resources become available upon the completion of other running queries. Which we call as Scale In vs Scale Out.

To solve this problem, you can add multiple clusters of a warehouse and distribute the queries to additional clusters which are added which we call as Mult cluster Warehouse – an Enterprise Snowflake Feature.

Ref Link: Multi-cluster warehouses | Snowflake Documentation

Part 1 Virtual Warehouse: Virtual Warehouse – Basics to Advanced (Part 1) (sqlcart.com)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top