In Snowflake, what happens when you query a materialized view that is not yet refreshed after the base table has changed?
Think about how materialized views store data separately and when they update.
Materialized views in Snowflake return data from their last refresh. They do not automatically refresh on query, so recent changes in the base table are not reflected until a manual or scheduled refresh occurs.
You have a large table that updates frequently. You want to optimize query speed for a complex aggregation that is used often. Which approach is best in Snowflake?
Consider trade-offs between query speed and data freshness.
Materialized views store precomputed results and speed up queries but require refresh to update data. This balances performance and data freshness better than standard views or manual copies.
In Snowflake, if a user has SELECT privilege on a base table but no privileges on a materialized view built on that table, what happens when the user tries to query the materialized view?
Think about how Snowflake enforces privileges on objects.
In Snowflake, privileges are required on the object being queried. Having access to the base table does not grant access to the materialized view. Without SELECT privilege on the materialized view, the query fails.
Which Snowflake feature allows automatic refresh of materialized views without manual intervention?
Think about how to automate SQL commands in Snowflake.
Snowflake does not have an AUTO_REFRESH property for materialized views. Instead, Snowflake Tasks can be used to schedule SQL commands that refresh materialized views automatically.
Which statement best describes the cost implications of using materialized views in Snowflake compared to standard views?
Consider what materialized views store and how they affect query processing.
Materialized views store precomputed data, increasing storage usage. However, they reduce compute costs by allowing faster query execution. Refreshing the view does consume compute, but queries do not always trigger full refreshes.