技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
django-materialized-views【数据与研究】Model, migrate, refresh, and verify PostgreSQL materialized views in Django for expensive report or dashboard queries that can tolerate stale data. Use when ORM/index/query rewrites are not enough, the result is read often, freshness can be bounded, and a Django app needs unmanaged models, RunSQL migrations, refresh commands, or concurrent refresh.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when an expensive read query is reused often and can tolerate controlled staleness. Try query-plan, index, and ORM expression improvements first; materialized views add operational state.
Confirm fit.
Design the materialized view.
Integrate with Django.
RunSQL.managed = False.Implement refresh.
REFRESH MATERIALIZED VIEW for simple refreshes.REFRESH MATERIALIZED VIEW CONCURRENTLY only when the view is already populated and has a qualifying unique index.See materialized-view-patterns.md for migration, model, and refresh templates.
Validate the SQL against source tables, test the unmanaged model reads, prove refresh behavior, and measure read latency before/after.