sqlsnowflake-cloud-data-platform

Is there a way to query procedure execution times in Snowflake?


I’m currently tracking execution times of stored procedures within snowflake by tracking start time and end time of each procedure call in snow spark, then calculating duration.

However, looking to see if this is already being tracked in Snowflake and how I can access this. Ultimately I want to generate a table with a history of execution times for all our procedures calls going forward


Solution

  • You can check the statement execution duration from the Snowflake.account_usage.query_history view by using the required filters

    Sample query

    select query_id, total_elapsed_time from snowflake.account_usage.query_history;
    

    https://docs.snowflake.com/en/sql-reference/account-usage/query_history