materialized-view

Diagnose StarRocks materialized view refresh and rewrite failures.

73|12|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/StarRocks/starrocks-debug-skills --skill materialized-view
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: materialized-view
Source: https://github.com/StarRocks/starrocks-debug-skills/tree/main/materialized-view
Command: npx skills add https://github.com/StarRocks/starrocks-debug-skills --skill materialized-view

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Use this Skill to troubleshoot StarRocks materialized views that fail to refresh, time out, become inactive, or stop being chosen for query rewrite. It helps isolate whether the root cause is memory pressure, timeout settings, schema changes, staleness tolerance, or scheduler disruption so you can restore reliable MV behavior.

Core Features & Use Cases

  • Refresh failure diagnosis: Inspect MV state, refresh history, and error messages to distinguish OOM, timeout, and inactive-state problems.
  • Query rewrite verification: Check whether queries hit the MV using EXPLAIN and TRACE analysis, then identify structural mismatches or staleness barriers.
  • Operational recovery: Apply targeted fixes such as spill-to-disk, timeout increases, reactivation, resource-group tuning, or schedule resets.
  • Use case: A production MV stops refreshing after an FE restart and query plans fall back to base tables; this Skill guides the investigation from symptoms to a concrete recovery plan.

Quick Start

Use the materialized-view skill to diagnose the failing StarRocks materialized view, determine the root cause from its state and task history, and recommend the exact SQL or configuration changes needed to restore refreshes and query rewrite.

Frequently Asked Questions about materialized-view

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my StarRocks materialized view fail to refresh or time out in production?

StarRocks materialized view refresh failures usually stem from memory pressure, timeout limits, or inactive states. Diagnose by inspecting SHOW MATERIALIZED VIEWS output and task run history to isolate OOM, timeout, or scheduler disruption, then apply targeted fixes like spill-to-disk or timeout increases.

How do I check if StarRocks query rewrite is hitting my materialized view?

To verify query rewrite selection for a StarRocks materialized view, run EXPLAIN and TRACE on your query to check if the plan hits the MV. Structural mismatches or staleness tolerance barriers can prevent rewrite, causing fallback to base tables.

What should I do when a StarRocks materialized view becomes inactive after an FE restart?

When a StarRocks materialized view becomes inactive after an FE restart, inspect its state and task run history to identify scheduler disruption. Recovery involves reactivating the MV, resetting the schedule, and tuning resource groups to restore reliable refresh behavior.

How do I fix StarRocks materialized views that stop being selected for query rewrite?

StarRocks materialized views stop being selected for query rewrite due to staleness barriers or structural mismatches. Use EXPLAIN and TRACE analysis to identify why rewrite fails, then apply targeted fixes like reactivation or schedule resets to restore MV selection.

Can I diagnose both async and sync StarRocks materialized view refresh failures?

Yes, you can diagnose both async and sync StarRocks materialized views that fail to refresh, time out, or become inactive. The Skill inspects MV state, task run history, and error messages to distinguish root causes like OOM, timeout, and staleness across both MV types.

What is the best way to troubleshoot StarRocks materialized view refresh and rewrite failures?

The best way to troubleshoot StarRocks materialized view failures is to inspect SHOW MATERIALIZED VIEWS, task run history, and EXPLAIN output. This isolates root causes like memory pressure, schema changes, or scheduler disruption, guiding targeted fixes for spill, timeout, and resource groups.