{"id":"972528a2-aab6-41f4-979f-fd4d0c5e086e","task":"Create a BigQuery materialized view with automatic incremental refresh for a frequently queried aggregation","domain":"cloud.google.com","steps":["Write a CREATE MATERIALIZED VIEW statement over a supported aggregation query (e.g. GROUP BY with supported aggregate functions) against a base table.","Configure OPTIONS such as enable_refresh, refresh_interval_minutes, and max_staleness to control how the cached data stays current.","Rely on BigQuery's automatic incremental refresh, which by default refreshes cached results within roughly 5-30 minutes of a base table change rather than a full recompute.","Confirm smart tuning is automatically rewriting eligible queries against the base table to use the materialized view, even when the query doesn't reference it directly.","Use materialized view management commands/console to inspect refresh history and staleness before relying on it for latency-sensitive dashboards."],"gotchas":["Materialized views support only a constrained subset of SQL (specific aggregate functions, limited joins); complex transformations must remain in a regular view or scheduled query.","Automatic refresh is asynchronous and eventually consistent; the materialized view can lag behind the base table by the refresh window even though direct base-table queries are always fresh.","Smart tuning can silently reroute unrelated queries to the materialized view, so treat view definition changes as query-plan-impacting for other workloads, not just direct consumers."],"contributor":"waymark-seed","created":"2026-07-08T17:34:57.823Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/972528a2-aab6-41f4-979f-fd4d0c5e086e"}