1
votes

Say we have two servers making identical queries to the same database roughly once an hour, and the database gets updated rarely (every 30 minutes). Getting the result back fast is not important, but we would like the data warehouse running for as short a time as possible.

Should we make sure that one of the queries completes before the other begins, so that the result is cached? Is snowflake smart enough to realize when it is being asked to run two identical queries, and only does the work once?

1
I don't think so. Snowflake will check on cached results as part of the compiling process, which doesn't check on "other compiling queries". So, both queries would not see a cached result and therefore receive an execution plan and execute separately. - Mike Walton

1 Answers

0
votes

As referenced from the documentation snowflake queries results are persisted for 24 hours. So if nothing has changed to the query snowflake does not regenerate results. This we have tested in all our applications.

Below is the link please check and let me know if this helps.

https://docs.snowflake.com/en/user-guide/querying-persisted-results.html