From 1ca6127f1aa8e72d35bf111b62c31ad28dfa60dd Mon Sep 17 00:00:00 2001 From: Oscar Bashaw Date: Wed, 20 Nov 2024 09:26:02 -0800 Subject: [PATCH] removed option for dbt package setup on CPQ template --- .../snowflake_cost_per_query_template.md | 37 ++----------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/site/sigmaguides/src/snowflake_cost_per_query_template/snowflake_cost_per_query_template.md b/site/sigmaguides/src/snowflake_cost_per_query_template/snowflake_cost_per_query_template.md index 5992fe91..80aa476d 100644 --- a/site/sigmaguides/src/snowflake_cost_per_query_template/snowflake_cost_per_query_template.md +++ b/site/sigmaguides/src/snowflake_cost_per_query_template/snowflake_cost_per_query_template.md @@ -46,46 +46,15 @@ How to deploy Sigma's **Snowflake Cost per Query** template. ![Footer](assets/sigma_footer.png) -## Building the query_history_enriched table with dbt -Duration: 5 - - -One way to create the `query_history_enriched` table is by deploying the dbt-snowflake-monitoring dbt package from Select. - -This package has a model called `query_history_enriched` that enriches the Snowflake `query_history` table with query cost information. It will calculate the actual cost (in currency) for every query run in your Snowflake account. - -Once the package has been deployed, Sigma needs to be able to access the table(s) created. -
    -
  1. Identify the role used in your Sigma connection. -
  2. Run the following command: -
- -```plaintext -grant select on table {database name}.{schema name}.query_history_enriched to role {role used in Sigma connection}; -``` -Note that you may need to grant usage on the database and schema that host this table. - -Verify that you can see the new table(s) in the Sigma connection browser: - - - -**Next, advance to step 4.** - -![Footer](assets/sigma_footer.png) - - ## Building the query_history_enriched table without dbt Duration: 5 - -Another way to create the `query_history_enriched` table is by running the attached SQL script in your Snowflake account. +You will create the `query_history_enriched` table by running the attached SQL script in your Snowflake account. [Download the SQL script here!](https://github.com/sigmacomputing/quickstarts-public/blob/main/snowflake_cost_per_query_template/query_history_enriched.sql) +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:**