I'm trying to look at the queries on certain tables and I'm getting weird results. I know for sure, there are atleast 5 queries on a certain table, but below queries are getting me different results. Anyone Snowflake users experienced similar issues.
SELECT QUERY_ID,QUERY_TEXT
from table(information_schema.query_history(
end_time_range_start=>to_timestamp_ltz ('2022-03-29 11:00:00.000000'),
end_time_range_end=>to_timestamp_ltz ('2022-03-29 14:00:00.000000')))
where UPPER(query_text) like '%TABLE_NAME%'
-- This returns one record as result, Really weird behavior is when I increased the time range filter, I'm getting zero records (for below query). Does Snowflake stop execution if it finds data is so large
SELECT QUERY_ID,QUERY_TEXT
from table(information_schema.query_history(
end_time_range_start=>to_timestamp_ltz ('2022-03-27 11:00:00.000000'),
end_time_range_end=>to_timestamp_ltz ('2022-03-29 15:00:00.000000')))
where UPPER(query_text) like '%TABLE_NAME%'
Currently I'm trying to run a script which calls above sql iteratively for 1 hour interval and loads to a different table which kind of gets me most of the data but feels like I still miss a lot of query history.