ExamGecko
Question list
Search
Search

Question 594 - COF-C02 discussion

Report
Export

A Snowflake user wants to optimize performance for a query that queries only a small number of rows in a table. The rows require significant processing. The data in the table does not change frequently.

What should the user do?

A.
Add a clustering key to the table.
Answers
A.
Add a clustering key to the table.
B.
Add the search optimization service to the table.
Answers
B.
Add the search optimization service to the table.
C.
Create a materialized view based on the query.
Answers
C.
Create a materialized view based on the query.
D.
Enable the query acceleration service for the virtual warehouse.
Answers
D.
Enable the query acceleration service for the virtual warehouse.
Suggested answer: C

Explanation:

In a scenario where a Snowflake user queries only a small number of rows that require significant processing and the data in the table does not change frequently, the most effective way to optimize performance is by creating a materialized view based on the query. Materialized views store the result of the query and can significantly reduce the computation time for queries that are executed frequently over unchanged data.

Why Materialized Views: Materialized views precompute and store the result of the query. This is especially beneficial for queries that require heavy processing. Since the data does not change frequently, the materialized view will not need to be refreshed often, making it an ideal solution for this use case.

Implementation Steps:

To create a materialized view, use the following SQL command:

CREATE MATERIALIZED VIEW my_materialized_view AS SELECT ... FROM my_table WHERE ...;

When the query is run, Snowflake uses the precomputed results from the materialized view, thus skipping the need for recalculating the data and improving query performance.

asked 23/09/2024
ahmed bin shehab
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first