altinity-expert-clickhouse-dictionaries

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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.

运行checks.sql文件中的所有查询并分析结果。

Dictionary Reload Operations

字典重载操作

Force Reload (syntax reference)

强制重载(语法参考)

sql
-- SYSTEM RELOAD DICTIONARY {database}.{name}
-- SYSTEM RELOAD DICTIONARIES
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}'

sql
-- 检查重载结果
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
元素数量推荐类型
< 100KFlat(如果是连续键)
100K - 10MHashed
> 10M考虑分区或缓存
复杂键ComplexKeyHashed
稀疏访问搭配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 usage
altinity-expert-clickhouse-memory
Overall memory analysis
Load failures
altinity-expert-clickhouse-overview
Error summary + routing
Source connectivity
altinity-expert-clickhouse-logs
Log investigation
Slow lookups
altinity-expert-clickhouse-reporting
Query optimization

发现问题加载模块原因
内存占用过高
altinity-expert-clickhouse-memory
整体内存分析
加载失败
altinity-expert-clickhouse-overview
错误汇总与路由
源端连通性问题
altinity-expert-clickhouse-logs
日志排查
查询缓慢
altinity-expert-clickhouse-reporting
查询优化

Settings Reference

设置参考

SettingNotes
dictionaries_lazy_load
Load on first access vs startup
dictionary_load_wait_timeout_ms
Wait time for lazy load
max_dictionary_num_to_warn
Warning threshold
设置项说明
dictionaries_lazy_load
首次访问时加载 vs 启动时加载
dictionary_load_wait_timeout_ms
懒加载等待时长
max_dictionary_num_to_warn
警告阈值