AgentSkillsCN

altinity-expert-clickhouse-dictionaries

全面分析 ClickHouse 外部字典,涵盖配置、内存使用情况、重新加载状态及性能表现。可用于排查字典相关问题及加载失败场景。

SKILL.md
--- frontmatter
name: altinity-expert-clickhouse-dictionaries
description: Analyze ClickHouse external dictionaries including configuration, memory usage, reload status, and performance. Use for dictionary issues and load failures.

Dictionary Diagnostics

Analyze external dictionaries: configuration, memory usage, reload status, and performance.


Diagnostics

Run all queries from the file checks.sql and analyze the results.


Dictionary Reload Operations

Force Reload (syntax reference)

sql
-- SYSTEM RELOAD DICTIONARY {database}.{name}
-- SYSTEM RELOAD DICTIONARIES

Check Reload Result for Specific Dictionary

sql
-- Check reload result
select
    name,
    status,
    loading_start_time,
    loading_duration,
    last_exception
from system.dictionaries
where name = '{dictionary_name}'

Best Practices

Dictionary Sizing Guidelines

ElementsRecommended Type
< 100KFlat (if sequential keys)
100K - 10MHashed
> 10MConsider partitioning or cache
Complex keysComplexKeyHashed
Sparse accessCache with SSD

Common Issues

SymptomCauseSolution
High memoryToo many elementsUse cache type, filter data
Slow reloadLarge source tableAdd filters, use delta updates
Stale dataSource unreachableCheck connectivity, add retry
Failed statusSource query failsCheck source table/query

Cross-Module Triggers

FindingLoad ModuleReason
High memory usagealtinity-expert-clickhouse-memoryOverall memory analysis
Load failuresaltinity-expert-clickhouse-overviewError summary + routing
Source connectivityaltinity-expert-clickhouse-logsLog investigation
Slow lookupsaltinity-expert-clickhouse-reportingQuery optimization

Settings Reference

SettingNotes
dictionaries_lazy_loadLoad on first access vs startup
dictionary_load_wait_timeout_msWait time for lazy load
max_dictionary_num_to_warnWarning threshold