nerdexam
Snowflake

ADA-C01 · Question #39

If the query matches the definition, will Snowflake always dynamically rewrite the query to use a materialized view?

The correct answer is B. No, because the optimizer might decide against it. Snowflake's query optimizer can automatically rewrite queries against the base table or regular views to use the materialized view instead, if the query matches the definition of the materialized view. However, this is not always guaranteed, as the optimizer might decide…

Performance Monitoring and Tuning

Question

If the query matches the definition, will Snowflake always dynamically rewrite the query to use a materialized view?

Options

  • ANo, because joins are not supported by materialized views.
  • BNo, because the optimizer might decide against it.
  • CNo, because the materialized view may not be up-to-date.
  • DYes, because materialized views are always faster.

How the community answered

(63 responses)
  • A
    8% (5)
  • B
    84% (53)
  • C
    2% (1)
  • D
    6% (4)

Explanation

Snowflake's query optimizer can automatically rewrite queries against the base table or regular views to use the materialized view instead, if the query matches the definition of the materialized view. However, this is not always guaranteed, as the optimizer might decide against using the materialized view based on various factors, such as the freshness of the data, the size of the result set, the complexity of the query, and the availability of the materialized view. Therefore, the answer is no, because the optimizer might decide against it.

Topics

#materialized views#query optimizer#query rewrite#performance

Community Discussion

No community discussion yet for this question.

Full ADA-C01 Practice