schema-design-advisor

Analyze ClickHouse table metrics to recommend schema optimizations.

255|42|Updated Nov 16, 2023
One-click install
npx skills add https://github.com/chmonitor/chmonitor --skill schema-design-advisor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-design-advisor
Source: https://github.com/chmonitor/chmonitor/tree/main/.agents/skills/schema-design-advisor
Command: npx skills add https://github.com/chmonitor/chmonitor --skill schema-design-advisor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Poorly designed ClickHouse table schemas with suboptimal ORDER BY keys, incorrect data types, missing indexes, and inefficient partitioning lead to slow query performance, excessive storage usage, and degraded merge operations. This skill eliminates these issues by providing evidence-based, workload-aligned schema optimization recommendations.

Core Features & Use Cases

  • Evidence-First Inspection: Guides users to gather table schema, parts summary, column compression metrics, and cardinality data before making any recommendations to ensure suggestions are grounded in actual usage.
  • Comprehensive Optimization Guidance: Covers ORDER BY design, partition key selection, column type right-sizing, compression codec selection, skip index configuration, and projection/materialized view recommendations for all common ClickHouse schema optimization scenarios.
  • Use Case: For a ClickHouse table with slow filter queries and 2x higher than expected storage costs, use this skill to analyze its actual usage patterns and receive actionable ALTER TABLE commands that cut query latency by 40% and reduce storage overhead.

Quick Start

Use the schema-design-advisor skill to analyze your ClickHouse table's current schema, parts, and column metrics, then receive prioritized, actionable recommendations for ORDER BY keys, partition strategies, data types, codecs, skip indexes, and projections to improve query performance and reduce storage costs.

Frequently Asked Questions about schema-design-advisor

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

FAQPage Schema
How do I optimize a ClickHouse table schema to reduce storage costs and query latency?

ClickHouse schema design optimization requires evidence-first inspection of table parts, column compression metrics, and cardinality data to deliver actionable recommendations. This ensures schema adjustments are grounded in actual usage patterns rather than assumptions.

How do I choose the right partition strategy for my ClickHouse table?

Selecting a partition strategy involves analyzing table parts summary and data lifecycle requirements to prevent degraded merge operations. Proper partition key selection aligns table structures with specific data workflows and avoids excessive storage consumption.

How do I use skip indexes to improve slow ClickHouse filter queries?

Skip indexes improve slow ClickHouse filter queries by allowing the database to skip reading irrelevant data parts during retrieval. Configuring them based on actual cardinality data and query workload analysis directly cuts query latency for filtered access patterns.

Can I use projections and materialized views to speed up ClickHouse queries?

Projections and materialized views accelerate ClickHouse queries by pre-materializing specific query patterns and aggregation results. Recommendations for implementing these structures are backed by actual table metrics and query workload analysis to ensure measurable performance gains.

Does this schema optimization approach work with managed ClickHouse deployments?

This schema optimization approach applies to both self-hosted and managed ClickHouse deployments. It delivers actionable ALTER TABLE commands to optimize table structures, ensuring engineers can apply evidence-based recommendations across different deployment environments.