> 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.
npx skills add https://github.com/FrankChen021/datastoria --skill clickhouse-system-queries
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.mdRelationship to sql-expert:
sql-expert handles general SQL generation and user/business tables.columns list via explore_schema instead of loading the full table schema.ProfileEvents is a Map, access entries as ProfileEvents['Name']. If flattened, use ProfileEvent_Name.Example — map vs flattened access:
-- 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();
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.search_query_log for standard ranked searches and filtered lookupsexecute_sql for visualization, time-bucketed aggregation, trends, or histograms -- 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.
system.query_log SQL until references/system-query-log.md is loaded in the current turnsearch_query_log for chart-oriented requestsLIMIT in exploratory queriesEfficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
Access BRENDA enzyme database via SOAP API. Retrieve kinetic parameters (Km, kcat), reaction equations, organism data, and substrate-specific enzyme information for biochemical research and metabolic pathway analysis.
Access ClinPGx pharmacogenomics data (successor to PharmGKB). Query gene-drug interactions, CPIC guidelines, allele functions, for precision medicine and genotype-guided dosing decisions.
Query NCBI ClinVar for variant clinical significance. Search by gene/position, interpret pathogenicity classifications, access via E-utilities API or FTP, annotate VCFs, for genomic medicine.
Access COSMIC cancer mutation database. Query somatic mutations, Cancer Gene Census, mutational signatures, gene fusions, for cancer research and precision oncology. Requires authentication.
Query Ensembl genome database REST API for 250+ species. Gene lookups, sequence retrieval, variant analysis, comparative genomics, orthologs, VEP predictions, for genomic research.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
Query NCBI Gene via E-utilities/Datasets API. Search by symbol/ID, retrieve gene info (RefSeqs, GO, locations, phenotypes), batch lookups, for gene annotation and functional analysis.
Take frankchen021/clickhouse-system-queries from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.