ワンクリックで
schema-diagnosis
Diagnose a column/table schema issue — Nullable overhead, oversized integer, or weak compression — and propose an ALTER.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Diagnose a column/table schema issue — Nullable overhead, oversized integer, or weak compression — and propose an ALTER.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Rules and strategies for exploring databases, tables, schemas, and searching metadata.
Complex rules for calling render_chart, inferring axes, and choosing chart types based on user intent.
Diagnose a ClickHouse server error (code/name/exception) and give a concrete, actionable fix.
Diagnose part/partition health of a MergeTree table — too many parts, slow/stuck merges, bad partition key.
Rules for using explain/analyze/optimize tools to help the user tune their queries.
Strict rules on outputting ClickHouse syntax, limiting rows, and rendering SQL in markdown.
| name | schema-diagnosis |
| description | Diagnose a column/table schema issue — Nullable overhead, oversized integer, or weak compression — and propose an ALTER. |
The user wants to know if a column/table is storing data wastefully and how to
fix it. Three common categories: nullable (a Nullable wrapper that's rarely
null), oversized (an integer wider than the data needs), compression (a
column compressing poorly / wrong codec). Ground every recommendation in real
numbers, then propose a concrete ALTER TABLE.
get_table_ddl — current column type, codec, engine.run_select_query, by category:
SELECT count() AS total, countIf(col IS NULL) AS nulls FROM db.table. If ~0, drop the wrapper.SELECT min(col) AS lo, max(col) AS hi FROM db.table SAMPLE 0.01. Pick the narrowest fitting Int/UInt.SELECT sum(data_compressed_bytes) AS comp, sum(data_uncompressed_bytes) AS uncomp FROM system.parts_columns WHERE database='db' AND table='t' AND column='col'. Ratio ≈ uncomp/comp.get_table_size — scale context for the rewrite cost.types-codecs-compression reference skill — integer sizing, LowCardinality, Nullable, codec selection (Delta/DoubleDelta/Gorilla/ZSTD).system-table-reference reference skill — exact system.columns / system.parts_columns columns.ALTER TABLE db.table MODIFY COLUMN … (drop Nullable / narrow the int / set CODEC), grounded in the numbers you measured.FORMAT clause. MODIFY COLUMN rewrites the column across all parts — note a human should validate on a sample first.