Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Clickhouse System Queries

ASecurity

Query ClickHouse system tables to inspect query logs, monitor cluster health, check replication status, and analyze slow queries. Use when the user mentions "system tables", "query_log", "ClickHouse monitoring", "cluster status", "slow queries", or asks to diagnose ClickHouse operational issues.

19 stars
0 votes
0 copies
0 views
Added 9/28/2026
toolssqlrails

Works with

cli

Security Analysis

A100/100

Scanned 9/28/2026

$npx -y skills add gabrielmoreira/agent-skills-mirror --skill clickhouse-system-queries --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clickhouse System Queries?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Clickhouse System Queries
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-clickhouse-system-queries/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-clickhouse-system-queries)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Files
SKILL.md
---
name: clickhouse-system-queries
description: >
  Query ClickHouse system tables to inspect query logs, monitor cluster health,
  check replication status, and analyze slow queries. Use when the user mentions
  "system tables", "query_log", "ClickHouse monitoring", "cluster status",
  "slow queries", or asks to diagnose ClickHouse operational issues.
metadata:
  author: DataStoria
  disable-slash-command: true
---

# ClickHouse System Queries Skill

Use this skill when the user asks for operational inspection on ClickHouse `system.*` tables.

Current table coverage:

- `system.query_log` via `references/system-query-log.md`

Relationship to `sql-expert`:

- `sql-expert` handles general SQL generation and user/business tables.
- This skill handles system-table operational patterns and routing to table-specific references.

## System Metrics and ProfileEvents

- Confirm column shape from schema/reference before writing predicates.
- If the user named an exact metric, pass it in the `columns` list via `explore_schema` instead of loading the full table schema.
- If `ProfileEvents` is a `Map`, access entries as `ProfileEvents['Name']`. If flattened, use `ProfileEvent_Name`.

Example — map vs flattened access:

```sql
-- Map access
SELECT ProfileEvents['DistributedConnectionFailTry'] AS fails
FROM system.query_log WHERE event_date = today();

-- Flattened column access
SELECT ProfileEvent_DistributedConnectionFailTry AS fails
FROM system.query_log WHERE event_date = today();
```

## Workflow

1. **Resolve target** — identify system table and intent. Inherit the most recent time window from conversation, or default to last 60 minutes.

2. **Load reference** — for `system.query_log`, call `skill_resource` to load `references/system-query-log.md` before writing any SQL. For unsupported tables, fall back to `sql-expert`.

3. **Execute** — choose the right tool:
   - `search_query_log` for standard ranked searches and filtered lookups
   - `execute_sql` for visualization, time-bucketed aggregation, trends, or histograms

   ```sql
   -- search_query_log: standard lookup
   -- finds top 10 slowest queries in the last hour

   -- execute_sql: time-bucketed visualization
   SELECT toStartOfFiveMinutes(event_time) AS bucket,
          count() AS queries,
          avg(query_duration_ms) AS avg_ms
   FROM system.query_log
   WHERE event_date = today() AND event_time > now() - INTERVAL 1 HOUR
   GROUP BY bucket ORDER BY bucket
   ```

   Default to `LIMIT 50` unless the user specifies otherwise.

4. **Summarize** with concise findings and next actions.

## Guardrails

- Always apply time bounds for log-like system tables
- Always use the table-specific reference when available
- Never generate `system.query_log` SQL until `references/system-query-log.md` is loaded in the current turn
- Never use `search_query_log` for chart-oriented requests
- Never omit `LIMIT` in exploratory queries

Attribution

gabrielmoreiragabrielmoreira
View sourceSee grades on GitHubMore from gabrielmoreira →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →