Skip to content

Commit 0697a67

Browse files
Update cost-per-query-in-snowflake-using-credits_attributed_compute-metric-in-query_attribution_history-view.md
1 parent 4b6aee2 commit 0697a67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cost-per-query-in-snowflake-using-credits_attributed_compute-metric-in-query_attribution_history-view.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
Snowflake has introduced a new View `QUERY_ATTRIBUTION_HISTORY` in `SNOWFLAKE.ACCOUNT_USAGE`. This View holds the Snowflake Credits consumption attributed to a single Query execution in Snowflake.
44

5-
```
5+
```sql
66
select
77
credits_used_query_acceleration
88
, credits_attributed_compute
99
, query_parameterized_hash
1010
from SNOWFLAKE.ACCOUNT_USAGE.QUERY_ATTRIBUTION_HISTORY
1111
```
1212

13-
This VIEW can be joined with `QUERY_HISTORY` View using `query_parameterized_hash` as JOIN Key to get an average of the Snowflake Credits consumed for a given query.
13+
This View can be joined with `QUERY_HISTORY` View using `query_parameterized_hash` as JOIN Key to get an average of the Snowflake Credits consumed for a given query.
1414

15-
```
15+
```sql
1616
select
1717
query_parameterized_hash
1818
, avg(credits_attributed_compute)
@@ -22,3 +22,5 @@ from SNOWFLAKE.ACCOUNT_USAGE.QUERY_ATTRIBUTION_HISTORY
2222
inner join SNOWFLAKE.ACCOUNT_USAGE.query_history using (query_parameterized_hash)
2323
group by all;
2424
```
25+
![carbon(8)](https://github.com/user-attachments/assets/3ca2007e-5650-4e1d-a0fb-8d2749ce1a6e)
26+

0 commit comments

Comments
 (0)