This QuickStart provides instructions on how to set up Sigma's Snowflake Cost per Query template.

This template give you a prebuilt analysis of Snowflake costs by Sigma workbook / user and by Snowflake user, role and warehouse.

There are two steps to setting up the template:

  1. Create the query_history_enriched table in your Snowflake account
  2. Launch the template in Sigma and Swap Sources to the table created in step 1

Target Audience

Anyone who is trying to calculate the Snowflake cost-per-query or aggregate costs across different dimensions.

Prerequisites

Sigma Free Trial

What You'll Learn

How to deploy Sigma's Snowflake Cost per Query template.

What You'll Build

Footer

You will create the query_history_enriched table by running the attached SQL script in your Snowflake account.

Download the SQL script here!

This script takes Snowflake's new query_attribution_history table, which attributes compute credits to each query, and uses it to enrich the query_history table. The script also sets up incremental materialization of the new query_history_enriched table so that it updates nightly.

The script requires you to specify a few parameters:

Run the SQL script in your Snowflake account, and then verify that you can see the new table(s) in the Sigma connection browser.

Footer

Once you have created the query_history_enriched table, go to Sigma.

From the home page, navigate to the Templates section, then to External.

Click on the Snowflake Cost per Query template:

You will be prompted to swap data sources. Click Swap Now:

Verify that Sigma has found the query_history_enriched table and click Swap Now:

Click Save As and give your workbook a title.

That's all there is to it!

You should now see the Snowflake Cost per Query Template on top of your own data.

For example:

Footer

In this QuickStart we created the query_history_enriched table and launched Sigma's Snowflake Cost per Query template.

If you're interested in a Snowflake Optimization tool, check out Select!

Additional Resource Links

Be sure to check out all the latest developments at Sigma's First Friday Feature page!

Help Center Home
Sigma Community
Sigma Blog

Footer