跳到正文
Skillpedia
数据库41k · #6856

auditing-warehouse-view-health

它能做什么

本技能对你的物化视图进行全项目检查,显示哪些正在失败,哪些在未被使用的情况下仍在产生费用。适合管理 PostHog 数据仓库的人。

适用场景

  • ✓当你想知道哪些物化视图已损坏时。
  • ✓当你怀疑某些视图占用了无人需要的存储或计算资源的时候。
  • ✓当基于物化视图的仪表盘数据过期或显示错误时。

技能链接

https://github.com/PostHog/posthog/blob/master/products/data_warehouse/skills/auditing-warehouse-view-health/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/data_warehouse/skills/auditing-warehouse-view-health/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的哪些物化视图已损坏?有没有哪些正在浪费计算资源?”

每周 5 个新技能,1 分钟读完。

工作原理

它会提取整个数据管道中所有失败和降级项目的一份列表,然后检查哪些视图已物化但未被使用,或已过期。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Auditing data warehouse view health

This skill produces a project-wide audit of materialized views (materialized saved queries) in the data warehouse — which ones are failing, and which are materialized but unused. Use it when the user wants a summary of view health, not a deep-dive on one failure.

The same underlying endpoint (data-warehouse-data-health-issues-retrieve) also reports source, sync, batch-export, and transformation issues. Source and sync health is covered by auditing-warehouse-source-health. Destinations (batch exports) and transformations are owned by other products — surface them if they appear, but route them to the relevant team rather than diagnosing here.

When to use this skill

  • "Which of my views are broken?" / "Why is this materialized view failing?"
  • "Are any of my materialized views wasting compute?"
  • Reviewing view health after a HogQL or schema change
  • Dashboards backed by materialized views are stale or erroring

Available tools

Tool Purpose
data-warehouse-data-health-issues-retrieve One-shot: all failed/degraded items across the whole pipeline
view-list All saved queries / materialized views with status and latest_error
view-run-history Run history for a specific materialized view
warehouse-suggestions-list PostHog's open deprecate / materialize / certify suggestions, if any

Filter the data-health-issues results to the materialized_view type for this audit. Use view-list when you need more than the active-failure summary (non-failing views, materialization flags, last-queried info) and view-run-history to see the run trail for a specific view.

What counts as a view "issue"

From the data-health endpoint, this audit cares about one of the five categories:

type Trigger Typical urgency
materialized_view DataWarehouseSavedQuery.is_materialized=true, status=Failed Medium

Each entry includes id, name, type, status, error, failed_at, and url.

The other categories the endpoint returns are out of scope for this skill:

  • source / external_data_sync → auditing-warehouse-source-health
  • destination (batch export) → owned by the batch exports / data pipelines product
  • transformation (HogFunction) → owned by the CDP / ingestion side

Note the data-health endpoint only reports active failures. For views it doesn't flag:

  • Non-materialized views with errors (only materialized views are reported)
  • Materialized views that are healthy but unused (costing compute every run) — see Step 4

Workflow

Step 1 — One-shot pull

Call data-warehouse-data-health-issues-retrieve and keep the materialized_view entries.

If there are no view issues, tell the user their materialized views are healthy and stop. Don't invent problems.

Step 2 — Triage failures

Materialized view failures are usually independent of sources — a view failure is a HogQL or data issue in the view itself (syntax error, missing table reference, type mismatch). For each failing view, surface the error and point at the offending query. Use view-run-history if the user wants the failure trail.

An error that starts with Not published: is not a query problem. The view's data quality checks failed and the refresh was held back. Hand off to debugging-failed-data-quality-checks.

Step 3 — Present the audit

Render a prioritized report. Don't dump the raw JSON — human-readable:

## Materialized view health — 2 issues

### 🟠 Materialized views (2)
- monthly_revenue — view failed (syntax error in HogQL: 'FORM' instead of 'FROM')
- active_users_30d — view failed (missing table reference)

Both are HogQL issues in the view definitions — independent of your sources. Want me to open one?

Step 4 — Go beyond active failures (when asked)

Start from PostHog's suggestions if the warehouse-suggestions-* tools are available. Call warehouse-suggestions-list with status=proposed. Pos

常见问题

这项技能会修复视图吗?

不会。它只生成失败和未使用视图的审计结果,由你决定下一步怎么做。

数据源同步问题怎么办?

数据源和同步健康状况由另一项审计技能负责,因此本技能专注于物化视图。

什么是物化视图?

它是一种保存的查询,其结果存储在实际的表中。读取可能更快,但会占用存储空间。

详情

作者的原始描述

Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and flag unused or stale materialized views that cost storage and compute. Use when the user asks "which of my views are broken?", "why is this materialized view failing?", "are any of my views wasting compute?", or wants a one-shot triage of view health. For source/sync health use `auditing-warehouse-source-health`.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6856
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能