How We Reduced Our Snowflake Compute Costs
How we uncovered 4-figure dollar savings monthly, and 5-figure dollar savings annually with 2 simple actions
![Erik Edelmann.](https://hightouch.com/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fpwmfmi47%2Fproduction%2Fd79f46b0da5de66fa9261712b19417c854c73abc-589x589.jpg%3Fw%3D200%26h%3D200%26fit%3Dcrop%26crop%3Dcenter&w=3840&q=75&dpl=dpl_2FtECsfwWKZkenrGpm439ukMoetJ)
Erik Edelmann
October 9, 2023
3 minutes
1st Observation and Action:
Our first observation was that this warehouse was indeed oversized. It was not overwhelmed by the workloads assigned to it, wasn’t queueing queries, and didn’t need to avoid queuing. It’s easy to look for this in Snowflake’s UI and with the account usage metadata they provide to all customers. Action: We reduced the size of the warehouse from Medium to Small in April, and while we saw our job durations jump because of this, we also saw total credit consumption reduced dramatically.
2nd Observation and Action:
Our second observation was that our jobs being run on this warehouse were being bottlenecked by 1 model in particular. Bottlenecking happens when a model is holding the job up instead of running in parallel with other models. Action: We decided to see what we could do to optimize this model and quickly found that we could leverage incremental materialization to reduce its normal run time by about 5 minutes or ~91%.
Results:
- The result of our first action (reducing the warehouse size) was that this warehouse consumed at least 10 fewer credits per day than before.
- The result of our second action (using incremental materialization for the bottleneck dbt model) also happened to reduce our consumption by about 10+ credits daily because this model was run very frequently.
- Altogether, these 2 simple actions created 4-figure dollar savings monthly, and 5-figure dollar savings annually 📊
We’ve attached images showing 1) the impact of these two changes on credit consumption and average query duration 2) the DAG bottleneck in one job and 3) the drop in run time for that job from the incremental materialization.
![Snowflake Consumption 3](https://hightouch.com/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fpwmfmi47%2Fproduction%2F3ae0a3d0b7cda7bc2f8a1710742951e7dd151a25-2048x1104.jpg&w=3840&q=75&dpl=dpl_2FtECsfwWKZkenrGpm439ukMoetJ)
![Snowflake Consumption 1](https://hightouch.com/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fpwmfmi47%2Fproduction%2F1a9f1d464ed81d3a2d39d527d1e106a75dcb83e5-2048x938.jpg&w=3840&q=75&dpl=dpl_2FtECsfwWKZkenrGpm439ukMoetJ)
![Snowflake Consumption 2](https://hightouch.com/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fpwmfmi47%2Fproduction%2F373684b559c0426ef800fe2196e7de51b6624550-1406x744.jpg&w=3840&q=75&dpl=dpl_2FtECsfwWKZkenrGpm439ukMoetJ)
Big thanks to Kevin Hu and the Metaplane team for making it trivial for us to monitor our dbt Cloud job run times (among many other things) Shout out to Niall Woodward of SELECT for your work on the dbt artifacts dbt package which can also be used to dig deeper into dbt artifacts more easily And of course thank you to dbt Labs and Snowflake for serving as core pillars of our data stack, powering everything from our dashboards and notebooks to our Hightouch syncs and beyond.