ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 7 - ADA-C01 discussion

Report
Export

A Snowflake Administrator is investigating why a query is not re-using the persisted result cache.

The Administrator found the two relevant queries from the SNOWFLAKE. ACCOUNT_USAGE. QUERY_HISTORY view:

Why is the second query re-scanning micro-partitions instead of using the first query's persisted result cache?

A.
The second query includes a CURRENT_TIMESTAMP () function.
Answers
A.
The second query includes a CURRENT_TIMESTAMP () function.
B.
The second query includes a CURRENT_DATE () function.
Answers
B.
The second query includes a CURRENT_DATE () function.
C.
The queries are executed with two different virtual warehouses.
Answers
C.
The queries are executed with two different virtual warehouses.
D.
The queries are executed with two different roles.
Answers
D.
The queries are executed with two different roles.
Suggested answer: A

Explanation:

The inclusion of the CURRENT_TIMESTAMP() function in the second query prevents it from re-using the first query's persisted result cache because this function makes each execution unique due to the constantly changing timestamp. According to theSnowflake documentation, ''The query does not include non-reusable functions, which return different results for successive runs of the same query. UUID_STRING, RANDOM, and RANDSTR are good examples of non-reusable functions.'' The CURRENT_TIMESTAMP() function is another example of a non-reusable function, as it returns the current date and time at the start of query execution, which varies for each run. Therefore, the second query is not identical to the first query, and the result cache is not reused. The other options are either incorrect or irrelevant to the question. Option B is incorrect, as the CURRENT_DATE() function is a reusable function, as it returns the same value for all queries executed within the same day. Option C is irrelevant, as the virtual warehouse used to execute the query does not affect the result cache reuse. Option D is also irrelevant, as the role used to execute the query does not affect the result cache reuse, as long as the role has the necessary access privileges for all the tables used in the query.

asked 23/09/2024
Serhan Azdiken
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first