Monitoring and O&M of Materialized Views
Key Monitoring Metrics of Materialized Views
| Category | Metric | Recommended Threshold |
|---|---|---|
| Data timeliness |
| Report an alarm if the data is invalid and is not refreshed after twice the refresh interval. |
| Query performance |
| Ensure that the query performance is significantly improved compared with that of the base table. |
| Refresh performance |
| Compare with historical data and pay attention to sudden increases. |
| Storage usage | Storage size of the materialized view and auxiliary table | Regularly evaluate the cost-effectiveness of storage overhead. |
Common System Views for Monitoring Materialized Views
- PG_MATVIEW: attribute information of a materialized view
- PG_MATVIEW_PARTITION: partition attribute information of a materialized view
- PG_MATVIEW_DEPEND: dependency information between a materialized view and its base table
- PV_MATVIEW_DETAIL: comprehensive display of attributes, dependencies, and refresh information
Common SQL Statements for Monitoring Materialized Views
- Check the status of all materialized views.
1SELECT * FROM pv_matview_detail ORDER BY matview;
- View refresh statistics.
1 2
SELECT matview,refresh_mode,refresh_method,mapping,active,refresh_count,last_refresh_start,last_refresh_end,(last_refresh_end-last_refresh_start) duration FROM pv_matview_detail ORDER BY matview;
- View query rewriting statistics.
1SELECT matview,active,rewrite_count FROM pv_matview_detail ORDER BY matview;
- View the mapping between materialized views and base table partitions.
1SELECT mapping as "base partition -> matview partition" FROM pv_matview_detail WHERE matview = 'test_base_mv1';
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot