Skip to content

Instantly share code, notes, and snippets.

@viggin543
Last active April 28, 2023 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viggin543/7c07ea7195b2ad1742c8ee645181e93c to your computer and use it in GitHub Desktop.
Save viggin543/7c07ea7195b2ad1742c8ee645181e93c to your computer and use it in GitHub Desktop.
snowsql cloud credits per querry
select
LEFT(query_text,300),USER_NAME, COUNT(LEFT(query_text,300)) as COUNT_QUERIES, SUM(CREDITS_USED_CLOUD_SERVICES)
from SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY as jb
where start_time between '2023-04-27' and '2023-04-28'
GROUP BY LEFT(query_text,300), USER_NAME
order by 3 desc nulls last LIMIT 100;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment