SnowPro Advanced: Architect — Question 121

The result cache is not being used on the following query:

select * from ORDERS Where O_ORDERDATE = date_trunc('day', current_timestamp());

The query is run hundreds of times a day by several different Analyst teams. The team members use different roles and warehouses. The table is updated once every month.

What can be done to ensure that the query uses the result cache?

Answer options

Correct answer: D

Explanation

The correct answer is D because using current_date() allows the query to leverage result caching, as it results in a more stable value that can be reused across different executions. The other options do not directly address the caching mechanism, as they focus on user roles or warehouse configurations, which do not impact how the SQL query is processed.