Snowflake, Sql, Performance, Data Science, Data Engineering.
query_id not in (select query_id from query_operator_stats_cache2); begin open c1; for record in c1 do fetch c1 into query_id, qid, session_id, query_tag; insert into query_operator_stats_cache2 select :qid, :session_id, :query_tag, * from table(get_query_operator_stats(:query_id)); end for; return