{
  "schemaVersion": "1.0",
  "item": {
    "slug": "clickhouse",
    "name": "ClickHouse",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/ivangdavila/clickhouse",
    "canonicalUrl": "https://clawhub.ai/ivangdavila/clickhouse",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/clickhouse",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clickhouse",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "ingestion.md",
      "memory-template.md",
      "performance.md",
      "queries.md",
      "setup.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/clickhouse"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/clickhouse",
    "agentPageUrl": "https://openagent3.xyz/skills/clickhouse/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clickhouse/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clickhouse/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "ClickHouse 🏠",
        "body": "Real-time analytics on billions of rows. Sub-second queries. No indexes needed."
      },
      {
        "title": "Setup",
        "body": "On first use, read setup.md for connection configuration."
      },
      {
        "title": "When to Use",
        "body": "User needs OLAP analytics, log analysis, time-series data, or real-time dashboards. Agent handles schema design, query optimization, data ingestion, and cluster administration."
      },
      {
        "title": "Architecture",
        "body": "Memory lives in ~/clickhouse/. See memory-template.md for structure.\n\n~/clickhouse/\n├── memory.md        # Connection profiles + query patterns\n├── schemas/         # Table definitions per database\n└── queries/         # Saved analytical queries"
      },
      {
        "title": "Quick Reference",
        "body": "TopicFileSetup & connectionsetup.mdMemory templatememory-template.mdQuery patternsqueries.mdPerformance tuningperformance.mdData ingestioningestion.md"
      },
      {
        "title": "1. Always Specify Engine",
        "body": "Every table needs an explicit engine. Default to MergeTree family:\n\n-- Time-series / logs\nCREATE TABLE events (\n    timestamp DateTime,\n    event_type String,\n    data String\n) ENGINE = MergeTree()\nORDER BY (timestamp, event_type);\n\n-- Aggregated metrics\nCREATE TABLE daily_stats (\n    date Date,\n    metric String,\n    value AggregateFunction(sum, UInt64)\n) ENGINE = AggregatingMergeTree()\nORDER BY (date, metric);"
      },
      {
        "title": "2. ORDER BY is Your Index",
        "body": "ClickHouse has no traditional indexes. The ORDER BY clause determines data layout:\n\nPut high-cardinality filter columns first\nPut range columns (dates, timestamps) early\nMatch your most common WHERE patterns\n\n-- Good: filters by user_id, then date range\nORDER BY (user_id, date, event_type)\n\n-- Bad: date first when you filter by user_id\nORDER BY (date, user_id, event_type)"
      },
      {
        "title": "3. Use Appropriate Data Types",
        "body": "Use CaseTypeWhyTimestampsDateTime or DateTime64Native time functionsLow-cardinality stringsLowCardinality(String)10x compressionEnums with few valuesEnum8 or Enum16Smallest footprintNullable only if neededNullable(T)Adds overheadIPsIPv4 or IPv64 bytes vs 16+"
      },
      {
        "title": "4. Batch Inserts",
        "body": "Never insert row-by-row. ClickHouse is optimized for batch writes:\n\n# Good: batch insert\nclickhouse-client --query=\"INSERT INTO events FORMAT JSONEachRow\" < batch.json\n\n# Bad: individual inserts in a loop\nfor row in data:\n    INSERT INTO events VALUES (...)\n\nMinimum batch: 1,000 rows. Optimal: 10,000-100,000 rows."
      },
      {
        "title": "5. Prewarm Queries with FINAL",
        "body": "Queries on ReplacingMergeTree/CollapsingMergeTree need FINAL for accuracy:\n\n-- May return duplicates/old versions\nSELECT * FROM users WHERE id = 123;\n\n-- Guaranteed latest version\nSELECT * FROM users FINAL WHERE id = 123;\n\nFINAL has performance cost. For dashboards, consider materialized views."
      },
      {
        "title": "6. Materialized Views for Speed",
        "body": "Pre-aggregate expensive computations:\n\nCREATE MATERIALIZED VIEW hourly_events\nENGINE = SummingMergeTree()\nORDER BY (hour, event_type)\nAS SELECT\n    toStartOfHour(timestamp) AS hour,\n    event_type,\n    count() AS events\nFROM events\nGROUP BY hour, event_type;"
      },
      {
        "title": "7. Check System Tables First",
        "body": "Before debugging, check system tables:\n\n-- Running queries\nSELECT * FROM system.processes;\n\n-- Recent query performance\nSELECT query, elapsed, read_rows, memory_usage\nFROM system.query_log\nWHERE type = 'QueryFinish'\nORDER BY event_time DESC\nLIMIT 10;\n\n-- Table sizes\nSELECT database, table, formatReadableSize(total_bytes) as size\nFROM system.tables\nORDER BY total_bytes DESC;"
      },
      {
        "title": "Common Traps",
        "body": "String instead of LowCardinality → 10x larger storage for status/type columns\nWrong ORDER BY → Full table scans instead of index lookups\nRow-by-row inserts → Massive part fragmentation, slow writes\nMissing TTL → Unbounded table growth, disk full\n**SELECT *** → Reads all columns, kills columnar advantage\nNullable everywhere → Overhead + NULL handling complexity\nForgetting FINAL → Stale/duplicate data in merge tables"
      },
      {
        "title": "Performance Checklist",
        "body": "Before running expensive queries:\n\nCheck EXPLAIN: EXPLAIN SELECT ... shows execution plan\nSample first: SELECT ... FROM table SAMPLE 0.01 for 1% sample\nLimit columns: Only SELECT what you need\nUse PREWHERE: Filters before reading all columns\nCheck parts: SELECT count() FROM system.parts WHERE table='X'\n\n-- PREWHERE optimization\nSELECT user_id, event_type, data\nFROM events\nPREWHERE date = today()\nWHERE event_type = 'click';"
      },
      {
        "title": "Adding TTL for Data Retention",
        "body": "-- Delete old data\nALTER TABLE events\nMODIFY TTL timestamp + INTERVAL 90 DAY;\n\n-- Move to cold storage\nALTER TABLE events\nMODIFY TTL timestamp + INTERVAL 30 DAY TO VOLUME 'cold';"
      },
      {
        "title": "Monitoring Disk Usage",
        "body": "SELECT\n    database,\n    table,\n    formatReadableSize(sum(bytes_on_disk)) as disk_size,\n    sum(rows) as total_rows,\n    count() as parts\nFROM system.parts\nWHERE active\nGROUP BY database, table\nORDER BY sum(bytes_on_disk) DESC;"
      },
      {
        "title": "External Endpoints",
        "body": "EndpointData SentPurposelocalhost:8123SQL queriesHTTP interfacelocalhost:9000SQL queriesNative TCP interface\n\nNo external services contacted. All queries run against user-specified ClickHouse instances."
      },
      {
        "title": "Security & Privacy",
        "body": "Data saved locally (with user consent):\n\nConnection profiles (host, port, database) in ~/clickhouse/memory.md\nQuery patterns and schema documentation\nAuthentication method preferences (password vs certificate)\n\nImportant: If you provide database passwords, they are stored in plain text in ~/clickhouse/. Consider using environment variables or connection profiles managed by clickhouse-client instead.\n\nThis skill does NOT:\n\nConnect to any ClickHouse without explicit user configuration\nSend data to external services\nAutomatically collect or store credentials without asking"
      },
      {
        "title": "Related Skills",
        "body": "Install with clawhub install <slug> if user confirms:\n\nsql — SQL query patterns\nanalytics — data analysis workflows\ndata-analysis — structured data exploration"
      },
      {
        "title": "Feedback",
        "body": "If useful: clawhub star clickhouse\nStay updated: clawhub sync"
      }
    ],
    "body": "ClickHouse 🏠\n\nReal-time analytics on billions of rows. Sub-second queries. No indexes needed.\n\nSetup\n\nOn first use, read setup.md for connection configuration.\n\nWhen to Use\n\nUser needs OLAP analytics, log analysis, time-series data, or real-time dashboards. Agent handles schema design, query optimization, data ingestion, and cluster administration.\n\nArchitecture\n\nMemory lives in ~/clickhouse/. See memory-template.md for structure.\n\n~/clickhouse/\n├── memory.md        # Connection profiles + query patterns\n├── schemas/         # Table definitions per database\n└── queries/         # Saved analytical queries\n\nQuick Reference\nTopic\tFile\nSetup & connection\tsetup.md\nMemory template\tmemory-template.md\nQuery patterns\tqueries.md\nPerformance tuning\tperformance.md\nData ingestion\tingestion.md\nCore Rules\n1. Always Specify Engine\n\nEvery table needs an explicit engine. Default to MergeTree family:\n\n-- Time-series / logs\nCREATE TABLE events (\n    timestamp DateTime,\n    event_type String,\n    data String\n) ENGINE = MergeTree()\nORDER BY (timestamp, event_type);\n\n-- Aggregated metrics\nCREATE TABLE daily_stats (\n    date Date,\n    metric String,\n    value AggregateFunction(sum, UInt64)\n) ENGINE = AggregatingMergeTree()\nORDER BY (date, metric);\n\n2. ORDER BY is Your Index\n\nClickHouse has no traditional indexes. The ORDER BY clause determines data layout:\n\nPut high-cardinality filter columns first\nPut range columns (dates, timestamps) early\nMatch your most common WHERE patterns\n-- Good: filters by user_id, then date range\nORDER BY (user_id, date, event_type)\n\n-- Bad: date first when you filter by user_id\nORDER BY (date, user_id, event_type)\n\n3. Use Appropriate Data Types\nUse Case\tType\tWhy\nTimestamps\tDateTime or DateTime64\tNative time functions\nLow-cardinality strings\tLowCardinality(String)\t10x compression\nEnums with few values\tEnum8 or Enum16\tSmallest footprint\nNullable only if needed\tNullable(T)\tAdds overhead\nIPs\tIPv4 or IPv6\t4 bytes vs 16+\n4. Batch Inserts\n\nNever insert row-by-row. ClickHouse is optimized for batch writes:\n\n# Good: batch insert\nclickhouse-client --query=\"INSERT INTO events FORMAT JSONEachRow\" < batch.json\n\n# Bad: individual inserts in a loop\nfor row in data:\n    INSERT INTO events VALUES (...)\n\n\nMinimum batch: 1,000 rows. Optimal: 10,000-100,000 rows.\n\n5. Prewarm Queries with FINAL\n\nQueries on ReplacingMergeTree/CollapsingMergeTree need FINAL for accuracy:\n\n-- May return duplicates/old versions\nSELECT * FROM users WHERE id = 123;\n\n-- Guaranteed latest version\nSELECT * FROM users FINAL WHERE id = 123;\n\n\nFINAL has performance cost. For dashboards, consider materialized views.\n\n6. Materialized Views for Speed\n\nPre-aggregate expensive computations:\n\nCREATE MATERIALIZED VIEW hourly_events\nENGINE = SummingMergeTree()\nORDER BY (hour, event_type)\nAS SELECT\n    toStartOfHour(timestamp) AS hour,\n    event_type,\n    count() AS events\nFROM events\nGROUP BY hour, event_type;\n\n7. Check System Tables First\n\nBefore debugging, check system tables:\n\n-- Running queries\nSELECT * FROM system.processes;\n\n-- Recent query performance\nSELECT query, elapsed, read_rows, memory_usage\nFROM system.query_log\nWHERE type = 'QueryFinish'\nORDER BY event_time DESC\nLIMIT 10;\n\n-- Table sizes\nSELECT database, table, formatReadableSize(total_bytes) as size\nFROM system.tables\nORDER BY total_bytes DESC;\n\nCommon Traps\nString instead of LowCardinality → 10x larger storage for status/type columns\nWrong ORDER BY → Full table scans instead of index lookups\nRow-by-row inserts → Massive part fragmentation, slow writes\nMissing TTL → Unbounded table growth, disk full\n**SELECT *** → Reads all columns, kills columnar advantage\nNullable everywhere → Overhead + NULL handling complexity\nForgetting FINAL → Stale/duplicate data in merge tables\nPerformance Checklist\n\nBefore running expensive queries:\n\nCheck EXPLAIN: EXPLAIN SELECT ... shows execution plan\nSample first: SELECT ... FROM table SAMPLE 0.01 for 1% sample\nLimit columns: Only SELECT what you need\nUse PREWHERE: Filters before reading all columns\nCheck parts: SELECT count() FROM system.parts WHERE table='X'\n-- PREWHERE optimization\nSELECT user_id, event_type, data\nFROM events\nPREWHERE date = today()\nWHERE event_type = 'click';\n\nCluster Administration\nAdding TTL for Data Retention\n-- Delete old data\nALTER TABLE events\nMODIFY TTL timestamp + INTERVAL 90 DAY;\n\n-- Move to cold storage\nALTER TABLE events\nMODIFY TTL timestamp + INTERVAL 30 DAY TO VOLUME 'cold';\n\nMonitoring Disk Usage\nSELECT\n    database,\n    table,\n    formatReadableSize(sum(bytes_on_disk)) as disk_size,\n    sum(rows) as total_rows,\n    count() as parts\nFROM system.parts\nWHERE active\nGROUP BY database, table\nORDER BY sum(bytes_on_disk) DESC;\n\nExternal Endpoints\nEndpoint\tData Sent\tPurpose\nlocalhost:8123\tSQL queries\tHTTP interface\nlocalhost:9000\tSQL queries\tNative TCP interface\n\nNo external services contacted. All queries run against user-specified ClickHouse instances.\n\nSecurity & Privacy\n\nData saved locally (with user consent):\n\nConnection profiles (host, port, database) in ~/clickhouse/memory.md\nQuery patterns and schema documentation\nAuthentication method preferences (password vs certificate)\n\nImportant: If you provide database passwords, they are stored in plain text in ~/clickhouse/. Consider using environment variables or connection profiles managed by clickhouse-client instead.\n\nThis skill does NOT:\n\nConnect to any ClickHouse without explicit user configuration\nSend data to external services\nAutomatically collect or store credentials without asking\nRelated Skills\n\nInstall with clawhub install <slug> if user confirms:\n\nsql — SQL query patterns\nanalytics — data analysis workflows\ndata-analysis — structured data exploration\nFeedback\nIf useful: clawhub star clickhouse\nStay updated: clawhub sync"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ivangdavila/clickhouse",
    "publisherUrl": "https://clawhub.ai/ivangdavila/clickhouse",
    "owner": "ivangdavila",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/clickhouse",
    "downloadUrl": "https://openagent3.xyz/downloads/clickhouse",
    "agentUrl": "https://openagent3.xyz/skills/clickhouse/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clickhouse/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clickhouse/agent.md"
  }
}