首页/数据/NoSQL 速查/索引统计 _stats
本包目录(322 条)
MongoDB99 条
Elasticsearch89 条
ClickHouse56 条时序与列式28 条选型与架构50 条

索引统计 _stats

_stats 汇总索引级别的文档数、存储字节、写入与检索计数、段与合并信息;按 level=shards 能看到分片分布是否均衡。

NoSQL 速查数据更新于 2026-10-12
接口GET /<index>/_stats 或 /_stats/<metric>
常用分段_stats/docs、_stats/store、_stats/indexing、_stats/search、_stats/segments
参数level=cluster|indices|shards;常用完整路径 /<index>/_stats/docs,store/indexing

示例

示例
GET /my-index/_stats/docs,store?level=shards
GET /my-index/_stats/search?level=indices
写入计数是累计值,做速率监控要由采集端求差分;段数持续增长说明合并没有跟上写入。

易错点

  • GET 整个 _stats 全量分段响应很大,监控采集一定要指定需要的分段
  • store 是主+副本合计口径,与 _cat/indices 的 store.size(同样含副本)核对时注意别混淆

数据来源与参考

  • Elasticsearch Guide: Index stats API
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌