# v1.3 正式发布、JSON2 路径索引与 PostgreSQL COPY FROM STDIN｜Greptime 月度精选 - No. 89

Source: https://greptime.cn/blogs/2026-10-31-greptimedb-monthly-report

## 内容概述

*2026 年 10 月 · 2026-10-01 – 2026-10-31*

本月主要更新：

- GreptimeDB v1.3.0 正式发布，native histogram 默认开启，新增可选的 Trace V2。
- main 分支（v1.4）上，JSON2 类型提示的路径支持倒排索引和跳数索引，JSON2 列可用于非 Append Only 表。
- main 分支上，PostgreSQL `COPY FROM STDIN` 支持导入 CSV 和 InfluxDB 行协议。

GreptimeDB [v1.3.0](https://github.com/GreptimeTeam/greptimedb/releases/tag/v1.3.0) 于 10 月 28 日正式发布，此前 [v1.3.0-beta.2](https://github.com/GreptimeTeam/greptimedb/releases/tag/v1.3.0-beta.2) 于 10 月 15 日发布（[发布说明](https://docs.greptime.cn/release-notes/release-1-3-0/)）。v1.3 的详细介绍将另文发布，这里简要列出：

- 默认接收 Prometheus Remote Write v2 和 OTLP 的 native histogram，PromQL 可直接查询。
- Trace V2 通过 `x-greptime-pipeline-name: greptime_trace_v2` 启用，span、scope、resource 属性存入三个 JSON2 列，不再为每个属性 key 建一列。
- 修复了多处 SQL 和 PromQL 查询结果错误，包括全文 bloom 索引导致 `matches_term` 漏掉匹配行的问题（[db#9470](https://github.com/GreptimeTeam/greptimedb/pull/9470)）。

从 v1.2 升级前需要确认：

- 滚动升级时，先升级全部 datanode，再升级 frontend；回滚时先回滚 frontend。v1.3 的 frontend 搭配 v1.2 的 datanode 时，可能重放已成功的写入，导致 Append Only 表出现重复行。升级完成前请保持 metasrv 维护模式开启。在 Kubernetes 上部署时，需要使用 greptimedb-operator v1.3.0 及以上版本（见[生态更新](#生态更新)）。
- `region_engine.mito.scan_memory_limit` 默认值改为系统内存的 25%，`scan_memory_on_exhausted = "wait"` 按 `"fail"` 处理。如需保持不限制，设置 `scan_memory_limit = "unlimited"`（[db#9101](https://github.com/GreptimeTeam/greptimedb/pull/9101)）。
- VRL pipeline 默认不能再调用环境变量、文件系统、主机名、网络和本地时区相关的函数。确有需要时设置 `pipeline.allow_vrl_host_access = true`（[db#9610](https://github.com/GreptimeTeam/greptimedb/pull/9610)）。
- 查询会跳过已有的全文 bloom 索引，直到 compaction 或 `ADMIN BUILD_INDEX` 重建这些索引。自动 flush 的默认间隔从 30 分钟缩短到 10 分钟。MySQL 文本协议返回的时间戳截断到微秒（[db#9831](https://github.com/GreptimeTeam/greptimedb/pull/9831)）。设置了 `service.namespace` 的 OTLP 指标，`job` 标签改为 `<namespace>/<service.name>`。其余变更见发布说明。

## 贡献者

过去一个月，来自 **27 位贡献者**的 **243 个 PR** 被合并。其中 **14 位社区贡献者**贡献了 **34 个 PR**。
欢迎新贡献者：**[@fengyue-xve](https://github.com/fengyue-xve)**、**[@Alorun](https://github.com/Alorun)**、**[@Byte-Naut](https://github.com/Byte-Naut)**、**[@NightG1owZ](https://github.com/NightG1owZ)**、**[@Aumnertic](https://github.com/Aumnertic)**、**[@dxqlovestudy](https://github.com/dxqlovestudy)**、**[@niladrix719](https://github.com/niladrix719)**、**[@Aetherance](https://github.com/Aetherance)**！

感谢本月提交代码的社区贡献者：

- **[@fengyue-xve](https://github.com/fengyue-xve)** *[db#9500](https://github.com/GreptimeTeam/greptimedb/pull/9500)* *[db#9487](https://github.com/GreptimeTeam/greptimedb/pull/9487)* *[db#9485](https://github.com/GreptimeTeam/greptimedb/pull/9485)* *[db#9483](https://github.com/GreptimeTeam/greptimedb/pull/9483)* *[db#9482](https://github.com/GreptimeTeam/greptimedb/pull/9482)* *[db#9473](https://github.com/GreptimeTeam/greptimedb/pull/9473)* *[db#9468](https://github.com/GreptimeTeam/greptimedb/pull/9468)* *[db#9450](https://github.com/GreptimeTeam/greptimedb/pull/9450)*
- **[@lczllx](https://github.com/lczllx)** *[db#9954](https://github.com/GreptimeTeam/greptimedb/pull/9954)* *[db#9749](https://github.com/GreptimeTeam/greptimedb/pull/9749)* *[db#9616](https://github.com/GreptimeTeam/greptimedb/pull/9616)* *[db#9474](https://github.com/GreptimeTeam/greptimedb/pull/9474)* *[db#9445](https://github.com/GreptimeTeam/greptimedb/pull/9445)*
- **[@Alorun](https://github.com/Alorun)** *[db#9951](https://github.com/GreptimeTeam/greptimedb/pull/9951)* *[db#9876](https://github.com/GreptimeTeam/greptimedb/pull/9876)* *[db#9753](https://github.com/GreptimeTeam/greptimedb/pull/9753)*
- **[@Aumnertic](https://github.com/Aumnertic)** *[db#9759](https://github.com/GreptimeTeam/greptimedb/pull/9759)* *[db#9332](https://github.com/GreptimeTeam/greptimedb/pull/9332)*
- **[@BootstrapperSBL](https://github.com/BootstrapperSBL)** *[db#9715](https://github.com/GreptimeTeam/greptimedb/pull/9715)* *[db#9586](https://github.com/GreptimeTeam/greptimedb/pull/9586)*
- **[@Byte-Naut](https://github.com/Byte-Naut)** *[db#9999](https://github.com/GreptimeTeam/greptimedb/pull/9999)* *[db#9956](https://github.com/GreptimeTeam/greptimedb/pull/9956)*
- **[@dhruvxvaishnav](https://github.com/dhruvxvaishnav)** *[db#9979](https://github.com/GreptimeTeam/greptimedb/pull/9979)* *[db#9830](https://github.com/GreptimeTeam/greptimedb/pull/9830)*
- **[@NightG1owZ](https://github.com/NightG1owZ)** *[db#9700](https://github.com/GreptimeTeam/greptimedb/pull/9700)* *[db#9519](https://github.com/GreptimeTeam/greptimedb/pull/9519)*
- **[@tian1220A](https://github.com/tian1220A)** *[db#9953](https://github.com/GreptimeTeam/greptimedb/pull/9953)* *[db#9357](https://github.com/GreptimeTeam/greptimedb/pull/9357)*
- **[@yihong0618](https://github.com/yihong0618)** *[db#9721](https://github.com/GreptimeTeam/greptimedb/pull/9721)* *[db#9453](https://github.com/GreptimeTeam/greptimedb/pull/9453)*
- **[@Aetherance](https://github.com/Aetherance)** *[db#9438](https://github.com/GreptimeTeam/greptimedb/pull/9438)*
- **[@DeviousCardi](https://github.com/DeviousCardi)** *[db#9446](https://github.com/GreptimeTeam/greptimedb/pull/9446)*
- **[@dxqlovestudy](https://github.com/dxqlovestudy)** *[db#9581](https://github.com/GreptimeTeam/greptimedb/pull/9581)*
- **[@niladrix719](https://github.com/niladrix719)** *[db#9455](https://github.com/GreptimeTeam/greptimedb/pull/9455)*

## PR 亮点

以下改动在 v1.3 切出发布分支之后合入 `main`，将随 v1.4 发布，可以通过 [nightly 构建](https://github.com/GreptimeTeam/greptimedb/releases)试用。

### [db#9324](https://github.com/GreptimeTeam/greptimedb/pull/9324) feat(json2): support inverted index

JSON2 类型提示可以为每个路径声明索引。`INVERTED INDEX` 和 `SKIPPING INDEX`（Bloom filter，[db#9967](https://github.com/GreptimeTeam/greptimedb/pull/9967)）在 flush 和 compaction 时构建，查询这些路径时可以按索引剪枝 SST，不必全部扫描。同一路径可以同时声明两种索引。

```sql
CREATE TABLE logs (
    ts TIMESTAMP TIME INDEX,
    attrs JSON2 (
        service.name STRING INVERTED INDEX,
        status BIGINT SKIPPING INDEX
    )
) WITH ('append_mode' = 'true');
```

通过 `ALTER TABLE` 修改类型提示不会重建已有 SST 上的索引，之后的 flush 和 compaction 才按新的类型提示构建。手动重建索引不会重建已有 SST 上的 JSON2 路径索引，还可能删除已经构建的路径索引。

JSON2 列现在也可以用于非 Append Only 表，支持 `last_row` 和 `last_non_null` 两种合并模式。新写入的对象整体替换旧对象，JSON2 列不能作为主键（[db#9985](https://github.com/GreptimeTeam/greptimedb/pull/9985)）。普通 JSON 列支持与 JSON2 相同的点号访问，可以用 `SELECT j.a.b` 读取嵌套字段（[db#9775](https://github.com/GreptimeTeam/greptimedb/pull/9775)）。

### [db#9297](https://github.com/GreptimeTeam/greptimedb/pull/9297) feat: COPY FROM STDIN for postgres interface

PostgreSQL 客户端可以用 `COPY ... FROM STDIN` 向表中流式导入数据，例如在 psql 中执行 `\copy cpu FROM 'cpu.csv' WITH (FORMAT csv, HEADER)`。必须显式指定格式：`csv`，或下文介绍的 `influxdb`。不支持 PostgreSQL 的 `text` 和 `binary` 格式。PR 中的基准测试显示，每批 2000 行时，COPY 写入约 997K 行/秒，`INSERT` 约 47K 行/秒。

`WITH (FORMAT influxdb)` 用于导入 InfluxDB 行协议数据，可选的 `precision` 默认为纳秒。每行数据自带 measurement，因此语句中不写表名：`COPY FROM STDIN WITH (FORMAT influxdb, precision 'ms')`。单条语句最多接受 64 MiB 数据（[db#9982](https://github.com/GreptimeTeam/greptimedb/pull/9982)）。

### [db#9754](https://github.com/GreptimeTeam/greptimedb/pull/9754) feat(otlp)!: support raw delta exponential histograms

OTLP delta exponential histogram 按原样以 native histogram 格式存储，带有 `otlp_aggregation_temporality="delta"` 标签。每个样本只记录自身区间内的计数：`sum_over_time(metric[3m])` 得到三分钟内的总量，再除以 180 得到每秒速率。

同一个 PR 移除了 v1.3 中仍保留的旧版 OTLP 指标转换。`otlp_metric_compat` 配置仍可接受，但不再影响指标的转换方式。依赖旧版指标名的仪表盘和告警，在迁移到 v1.4 前需要检查。

Prometheus Remote Read 也支持返回 native histogram（[db#9971](https://github.com/GreptimeTeam/greptimedb/pull/9971)），v1.3.0 尚不支持。

### 其他更新

- 存储：TWCS 不再对没有新数据写入的时间窗口反复重写 L1 文件。PR 中 6 小时、5% 迟到数据的基准测试里，写放大从 40.7 降到 3.3，无效 compaction 从 327 次降到 0 次（[db#9741](https://github.com/GreptimeTeam/greptimedb/pull/9741)）。Compaction 的合并与编码改为流水线执行，`experimental_compaction_output_parallelism`（默认 `1`）可以并行处理单个输出文件的解码和编码（[db#9945](https://github.com/GreptimeTeam/greptimedb/pull/9945)）。列可以单独设置压缩和编码方式，例如 `"prompt" STRING COMPRESSION WITH (type = 'zstd', level = 3, page_size = '8MiB')`；新建的 trace 表对 span ID 使用 plain 编码（[db#9426](https://github.com/GreptimeTeam/greptimedb/pull/9426)、[db#9629](https://github.com/GreptimeTeam/greptimedb/pull/9629)）。
- Jaeger UI v2 可以通过新增的 `/v1/jaeger/api/v3` 接口查询 GreptimeDB，包括服务、操作、trace 查找和搜索。原有接口继续可用（[db#9409](https://github.com/GreptimeTeam/greptimedb/pull/9409)）。
- v1.4 的两项不兼容变更：手动设置了 `primary_key_encoding = 'sparse'` 的表必须包含 metric engine 的保留主键列，否则会被拒绝（[db#10020](https://github.com/GreptimeTeam/greptimedb/pull/10020)）；datanode 的 Kafka WAL 索引已移除，`create_index` 和 `dump_index_interval` 配置不再生效（[db#9563](https://github.com/GreptimeTeam/greptimedb/pull/9563)）。
- 社区贡献：在默认的 `sync_write = false` 下，raft-engine WAL 的定期 sync 此前从未执行 fsync，现已修复（[db#9715](https://github.com/GreptimeTeam/greptimedb/pull/9715)）。Pipeline 新增 `logfmt` processor（[db#9586](https://github.com/GreptimeTeam/greptimedb/pull/9586)），日志写入接口支持 Fluent Bit `json_stream` 输出使用的 `application/x-json-stream`（[db#9581](https://github.com/GreptimeTeam/greptimedb/pull/9581)）。`TRUNCATE TABLE` 支持 `WITH (wait = ..., timeout = ...)`（[db#9753](https://github.com/GreptimeTeam/greptimedb/pull/9753)），datanode 启动前会检查每个对象存储能否正常写入、读取、列出和删除（[db#9954](https://github.com/GreptimeTeam/greptimedb/pull/9954)）。

## 生态更新

### Operator 与 Helm Charts

[greptimedb-operator v0.7.0](https://github.com/GreptimeTeam/greptimedb-operator/releases/tag/v0.7.0) 默认启用独立的 HTTP API server，要求 GreptimeDB v1.2.1 及以上版本。GreptimeDB 版本较旧时，升级 operator 前需要在集群 CR 中设置 `enableHttpApiServer: false`。[v1.3.0](https://github.com/GreptimeTeam/greptimedb-operator/releases/tag/v1.3.0) 新增日志和 OTLP 导出配置。从这个版本起，operator 版本号与 GreptimeDB 对齐：GreptimeDB v1.3.0 需要搭配 operator v1.3.0 及以上版本。

Helm Charts 采用相同的版本规则。[greptimedb-cluster 1.3.0](https://github.com/GreptimeTeam/helm-charts/releases/tag/greptimedb-cluster-1.3.0) 和 [greptimedb-standalone 1.3.1](https://github.com/GreptimeTeam/helm-charts/releases/tag/greptimedb-standalone-1.3.1) 默认部署 GreptimeDB v1.3.0，[greptimedb-operator 1.3.0](https://github.com/GreptimeTeam/helm-charts/releases/tag/greptimedb-operator-1.3.0) 部署 operator v1.3.0。greptimedb-cluster 1.3.0 需要搭配 greptimedb-operator chart 1.3.0 及以上版本（[兼容性矩阵](https://github.com/GreptimeTeam/helm-charts/tree/main/charts/greptimedb-cluster#compatibility-matrix)）。

### Dashboard

[v0.14.2](https://github.com/GreptimeTeam/dashboard/releases/tag/v0.14.2) 随 v1.3.0 一起发布，新增 Signals Explore，可以按标签筛选指标、日志和 trace，并在日志和 trace 之间互相跳转。Native histogram 和 gauge histogram 暂不支持绘图。时区设置同时作用于时间显示和 SQL 请求，日志表支持滚动浏览大量结果，按 Trace ID 查询的问题已修复。

### MCP Server

[v0.6.1](https://github.com/GreptimeTeam/greptimedb-mcp-server/releases/tag/v0.6.1) 将 pipeline 和 dashboard 的写操作纳入只读模式控制：`create_pipeline`、`delete_pipeline`、`create_dashboard` 和 `delete_dashboard` 需要设置 `--allow-write true` 或 `GREPTIMEDB_ALLOW_WRITE=true`。工具输出默认上限为 1 MiB（`GREPTIMEDB_MAX_RESULT_BYTES`），`search_table_semantics` 新增 `schema` 参数，可以在其他数据库中查找。

## 参与社区

- 文档：https://docs.greptime.cn
- GitHub：https://github.com/GreptimeTeam/greptimedb
- X：https://x.com/Greptime

有 bug 或功能需求，欢迎提 issue，也可以到社区群里交流。
