← Back to Skills Marketplace
volcengine-skills

Byted Bytehouse Slow Query

by volcengine-skills · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
101
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install byted-bytehouse-slow-query
Description
ByteHouse慢查询分析和性能优化工具,用于识别和分析慢查询、查询性能优化建议、查看查询执行计划、分析查询历史趋势。当用户需要识别和分析ByteHouse数据库中的慢查询、查询性能优化建议、查看查询执行计划、分析查询历史趋势时,使用此Skill。
README (SKILL.md)

ByteHouse 慢查询分析 Skill

🔵 ByteHouse 品牌标识

「ByteHouse」—— 火山引擎云原生数据仓库,极速、稳定、安全、易用

本Skill基于ByteHouse MCP Server,提供完整的慢查询分析和性能优化能力


描述

ByteHouse慢查询分析和性能优化工具。

当以下情况时使用此 Skill: (1) 需要识别和分析慢查询 (2) 需要查询性能优化建议 (3) 需要查看查询执行计划 (4) 需要分析查询历史趋势 (5) 用户提到"慢查询"、"查询优化"、"性能分析"、"执行计划"

前置条件

  • Python 3.8+
  • uv (已安装在 /root/.local/bin/uv)
  • ByteHouse MCP Server Skill - 本skill依赖 bytehouse-mcp skill提供的ByteHouse访问能力

依赖关系

本skill依赖 bytehouse-mcp skill,使用其提供的MCP Server访问ByteHouse。

确保 bytehouse-mcp skill已正确配置并可以正常使用。

📁 文件说明

  • SKILL.md - 本文件,技能主文档
  • slow_query_analyzer.py - 慢查询分析主程序
  • README.md - 快速入门指南

配置信息

ByteHouse连接配置

本skill复用 bytehouse-mcp skill的配置。请确保已在 bytehouse-mcp skill中配置好:

export BYTEHOUSE_HOST="\x3CByteHouse-host>"
export BYTEHOUSE_PORT="\x3CByteHouse-port>"
export BYTEHOUSE_USER="\x3CByteHouse-user>"
export BYTEHOUSE_PASSWORD="\x3CByteHouse-password>"
export BYTEHOUSE_SECURE="true"
export BYTEHOUSE_VERIFY="true"

🎯 功能特性

1. 慢查询识别

  • 从query_log表获取慢查询
  • 按执行时间排序
  • 识别Top N慢查询
  • 分析慢查询模式

2. 查询性能分析

  • 查询执行时间分布
  • 查询类型统计
  • 查询频率分析
  • 性能趋势分析

3. 执行计划分析

  • 获取查询执行计划
  • 分析执行计划节点
  • 识别性能瓶颈
  • 提供优化建议

4. 优化建议生成

  • 索引优化建议
  • 查询重写建议
  • 表引擎建议
  • 配置参数调优

🚀 快速开始

方法1: 运行慢查询分析

cd /root/.openclaw/workspace/skills/bytehouse-slow-query

# 先设置环境变量(复用bytehouse-mcp的配置)
export BYTEHOUSE_HOST="\x3CByteHouse-host>"
export BYTEHOUSE_PORT="\x3CByteHouse-port>"
export BYTEHOUSE_USER="\x3CByteHouse-user>"
export BYTEHOUSE_PASSWORD="\x3CByteHouse-password>"
export BYTEHOUSE_SECURE="true"
export BYTEHOUSE_VERIFY="true"

# 运行慢查询分析
uv run slow_query_analyzer.py

分析内容包括:

  • Top 20慢查询
  • 查询性能统计
  • 执行时间分布
  • 优化建议生成

输出文件(保存在 output/ 目录):

  1. slow_queries_{timestamp}.json - 慢查询列表
  2. query_stats_{timestamp}.json - 查询统计报告
  3. optimization_suggestions_{timestamp}.json - 优化建议

💻 慢查询分析维度

时间维度分析

  • 按小时: 每小时慢查询数量
  • 按天: 每天慢查询趋势
  • 按周: 每周慢查询模式
  • 按月: 每月慢查询统计

查询类型分析

  • SELECT查询: 查询语句分析
  • INSERT查询: 写入性能分析
  • UPDATE查询: 更新性能分析
  • DELETE查询: 删除性能分析
  • DDL查询: 建表/改表性能分析

性能指标

  • 平均执行时间: 所有查询平均耗时
  • P50执行时间: 中位数执行时间
  • P95执行时间: 95分位执行时间
  • P99执行时间: 99分位执行时间
  • 最大执行时间: 最慢查询耗时

📊 慢查询报告示例

慢查询列表

{
  "analysis_time": "2026-03-12T21:00:00",
  "total_queries": 10000,
  "slow_queries": 150,
  "top_slow_queries": [
    {
      "query_id": "query-12345",
      "query_text": "SELECT * FROM large_table WHERE ...",
      "duration_ms": 15000,
      "start_time": "2026-03-12T20:55:00",
      "read_rows": 1000000,
      "read_bytes": 104857600
    }
  ]
}

📚 更多信息

详细使用说明请参考 bytehouse-mcp skill


最后更新: 2026-03-12

Usage Guidance
Before installing or running this skill: - Verify prerequisites and binaries: confirm whether the agent environment actually has 'uv' or 'uvx' at the paths referenced. The SKILL.md and script disagree (uv vs uvx); ask the author which is required. - Inspect the bytehouse-mcp dependency: the script will ask a subprocess to fetch and run code from github.com/volcengine/mcp-server at runtime. Review that repository/subdirectory yourself and prefer a pinned, reviewed release rather than on-the-fly git+https installs. - Limit environment exposure: the script forwards os.environ.copy() to the MCP subprocess. Do not run this in an environment containing unrelated secrets (cloud keys, tokens). Ideally modify the script to pass only the explicit ByteHouse variables it needs. - Treat as untrusted until verified: run the tool in an isolated environment (ephemeral VM or container) with only the minimal ByteHouse credentials and no other sensitive env vars. - Ask the publisher to: (1) declare required binaries and env vars in metadata, (2) remove or restrict passing the full environment, (3) avoid dynamic remote code execution or use a pinned release/tarball from a known release tag. - If you cannot verify these points, do not run this skill against production systems or environments containing sensitive credentials.
Capability Analysis
Type: OpenClaw Skill Name: byted-bytehouse-slow-query Version: 1.0.0 The skill is a legitimate tool for analyzing ByteHouse database performance. It uses the Model Context Protocol (MCP) to execute diagnostic SQL queries against system logs and generates local JSON reports. The code in slow_query_analyzer.py is transparent, follows the stated purpose, and uses official Volcano Engine (ByteHouse provider) GitHub repositories for its dependencies without any signs of data exfiltration or malicious intent.
Capability Assessment
Purpose & Capability
The skill's name, description, and included script all focus on ByteHouse slow-query analysis and depend on an MCP Server client—this is coherent. However, the registry metadata declares no required binaries or env vars, while SKILL.md and the script both expect/use external tooling (uv / uvx) and ByteHouse credentials. The missing declaration of those runtime requirements is an inconsistency.
Instruction Scope
SKILL.md instructs users to set ByteHouse connection env vars and to run the script with 'uv', but the runtime script launches a separate MCP stdio client process and will forward all environment variables to that subprocess. The script also constructs SQL queries against system.query_log (expected for this tool), but it does not limit or sanitize which environment variables are exposed to the external mcp server process — this could leak unrelated secrets from the agent environment.
Install Mechanism
There is no install spec, but the script sets StdioServerParameters.command to '/root/.local/bin/uvx' and includes args that reference a git+https URL (github.com/volcengine/mcp-server@main#subdirectory=server/mcp_server_bytehouse). At runtime this will cause dynamic fetching/execution of code via a tooling executable (uvx). Fetching and executing remote code at runtime is higher risk even if the host is GitHub; additionally the SKILL.md claims 'uv' lives at /root/.local/bin/uv while the script uses /root/.local/bin/uvx — an inconsistency that should be clarified.
Credentials
SKILL.md asks only for ByteHouse-related env vars (BYTEHOUSE_HOST, BYTEHOUSE_PORT, BYTEHOUSE_USER, BYTEHOUSE_PASSWORD, BYTEHOUSE_SECURE, BYTEHOUSE_VERIFY), but the script copies os.environ.copy() and passes the entire environment into the external MCP process. The registry metadata declared no required env, so required credentials are not surfaced in metadata. Passing the entire agent environment can expose unrelated secrets to the spawned process and any remote code it downloads/executes.
Persistence & Privilege
The skill is user-invocable and not marked always:true, and there is no evidence it modifies other skills or global config. However, its runtime behavior (launching a subprocess that may fetch and run remote code, and forwarding the entire environment) increases blast radius while running — run-time privileges are higher than what the metadata indicates.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install byted-bytehouse-slow-query
  3. After installation, invoke the skill by name or use /byted-bytehouse-slow-query
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the byted-bytehouse-slow-query skill. - Provides tools for identifying and analyzing slow queries in ByteHouse. - Offers performance analysis, execution plan insights, and optimization suggestions. - Supports trend analysis across different time dimensions and query types. - Outputs slow query reports, statistics, and optimization recommendations as JSON files. - Integrates with the bytehouse-mcp skill for ByteHouse access.
Metadata
Slug byted-bytehouse-slow-query
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Byted Bytehouse Slow Query?

ByteHouse慢查询分析和性能优化工具,用于识别和分析慢查询、查询性能优化建议、查看查询执行计划、分析查询历史趋势。当用户需要识别和分析ByteHouse数据库中的慢查询、查询性能优化建议、查看查询执行计划、分析查询历史趋势时,使用此Skill。 It is an AI Agent Skill for Claude Code / OpenClaw, with 101 downloads so far.

How do I install Byted Bytehouse Slow Query?

Run "/install byted-bytehouse-slow-query" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Byted Bytehouse Slow Query free?

Yes, Byted Bytehouse Slow Query is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Byted Bytehouse Slow Query support?

Byted Bytehouse Slow Query is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Byted Bytehouse Slow Query?

It is built and maintained by volcengine-skills (@volcengine-skills); the current version is v1.0.0.

💬 Comments