Snowflake persisted query results enable the query engine to reuse previously computed results when eligible identical queries are executed again.
Option D is the intended optimization because CURRENT_DATE expresses the business requirement using date-level precision rather than calculating an execution-time timestamp and subsequently converting it to a date.
This is more appropriate for reports whose date boundaries change daily rather than with every query execution.
Option A is incorrect because wrapping SQL inside a UDF does not automatically make queries eligible for persisted-result reuse.
Option B is incorrect because persisted query results are not tied to the local data cache of a particular virtual warehouse.
Option C is unnecessary because Snowflake can reuse eligible persisted SELECT results across roles when the executing roles have the required access privileges.
Snowflake also requires compatible query text, unchanged underlying data, an available cached result, and appropriate configuration settings. Persisted results generally expire after 24 hours, although successful reuse can extend their availability.
Critical source-query warning: The exhibit reverses its BETWEEN boundaries: the current date appears before the date seven days earlier. This must be corrected before deployment. Furthermore, CURRENT_DATE is session-time-zone-dependent, and Snowflake does not guarantee cache reuse merely because CURRENT_TIMESTAMP is replaced. The answer is the best of the available choices, not a guaranteed cache optimization.
Official Snowflake references: Using Persisted Query Results; CURRENT_DATE; Context Functions.
Submit