文档文档

显示关于Distinct Value Cache的信息

使用 influxdb3 show system table 命令distinct_caches 系统表中查询并输出唯一值缓存信息。

influxdb3 show system \
  --database 
DATABASE_NAME
\
--token
AUTH_TOKEN
\
table distinct_caches

这将返回一个类似于以下内容的表:

tablenamecolumn_idscolumn_namesmax_cardinalitymax_age_seconds
wind_datawind_distinct[0, 1, 2][country, county, city]10000086400
weatherweather_distinct[0][location]100604800
bitcoinbitcoin_dis[0, 1][code, crypto]500086400
homehome_distinct[0, 1][room, wall]1200015770000

从 distinct_caches 系统表中查询特定列

使用 --select 选项从 distinct_caches 系统表中查询特定列。提供一个逗号分隔的列列表以返回。

influxdb3 show system \
  --database 
DATABASE_NAME
\
--token
AUTH_TOKEN
\
table distinct_caches \ --select name,column_names,max_age_seconds

对 distinct_caches 系统表输出进行排序

使用 --order-by 选项按特定列对 distinct_caches 系统表的数据进行排序。提供一个逗号分隔的列列表以进行排序。

influxdb3 show system \
  --database 
DATABASE_NAME
\
--token
AUTH_TOKEN
\
table distinct_caches \ --order-by max_cardinality,max_age_seconds

结果将根据提供的列按升序排序。

在上面的示例中,替换以下内容:

  • DATABASE_NAME:要从中查询系统数据的数据库名称。
  • AUTH_TOKEN: 您的 InfluxDB 3 Core 认证令牌

使用 HTTP API

要使用 HTTP API 查询并输出系统表中的缓存信息,请向 /api/v3/query_sql 端点发送 GETPOST 请求。

GET /api/v3/query_sql
POST /api/v3/query_sql

查询所有缓存

curl -X POST "https://:8181/api/v3/query_sql" \
  --header "Authorization: Bearer 
AUTH_TOKEN
"
\
--json '{ "db": "
DATABASE_NAME
",
"q": "SELECT * FROM system.distinct_caches", "format": "json" }'

查询特定的缓存详细信息

curl -X POST "https://:8181/api/v3/query_sql" \
  --header "Authorization: Bearer 
AUTH_TOKEN
"
\
--json '{ "db": "
DATABASE_NAME
",
"q": "SELECT * FROM system.distinct_caches WHERE name = '\''
CACHE_NAME
'
\''",
"format": "json" }'

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2