# 稀疏主键编码性能提升 235%，Flat Format 推进中，OTLP 支持自定义 Header｜Greptime 双周精选

Source: https://greptime.cn/blogs/2025-09-03-greptimedb-biweekly-report

## 内容概述
作为一个成长中的开源项目，GreptimeDB 的进展离不开来自全球的社区贡献者们，感谢各位！

最近的更新内容如下：

- **Flat Format 推进中**：完善范围扫描与写入路径
- **分布式查询优化**：计划阶段裁剪无关 Region
- OTLP 上报支持**自定义 Header**
- 稀疏主键编码性能最高**提升 235%**

## 社区贡献者名单

在过去的两周里，GreptimeDB 共合并了 **122 个 PR**，其中有 **7 位独立贡献者**，累计 **7 个 PR** 被成功合并，还有很多待合并的 PR 。

祝贺以下各位在过去 2 周内成为我们最突出的贡献者：
 
> 注：按照 GitHub 用户名首字母顺序排列
> - @**[Arshdeep54](https://github.com/Arshdeep54)** *[db#6619](https://github.com/GreptimeTeam/greptimedb/pull/6619)* 
> - @**[aaraujo](https://github.com/aaraujo)** *[db#6780](https://github.com/GreptimeTeam/greptimedb/pull/6780)* 
> - @**[codephage2020](https://github.com/codephage2020)** *[db#6818](https://github.com/GreptimeTeam/greptimedb/pull/6818)*
> - @**[SNC123](https://github.com/SNC123)** *[db#6757](https://github.com/GreptimeTeam/greptimedb/pull/6757)* 
> - @**[WaterWhisperer](https://github.com/WaterWhisperer)** *[db#6863](https://github.com/GreptimeTeam/greptimedb/pull/6863)* 
> - @**[yihong0618](https://github.com/yihong0618)** *[db#6704](https://github.com/GreptimeTeam/greptimedb/pull/6704)*
> - @**[zqr10159](https://github.com/zqr10159)** *[db#6764](https://github.com/GreptimeTeam/greptimedb/pull/6764)* 

👏 欢迎 @**[aaraujo](https://github.com/aaraujo)** 和 @**[WaterWhisperer](https://github.com/WaterWhisperer)** 作为新的贡献者加入到社区，并成功合并了 PR，还有更多来自其他独立贡献者的 PR 正在等待合并。

<figure>
<img src="/zh/blogs/2025-09-03-greptimedb-biweekly-report/greptimedbcontributor.png" alt="（图 1：GreptimeDB 双周内新增贡献者）" style="width: 80%; margin: 0 auto"/>
<figcaption>（图 1：GreptimeDB 双周内新增贡献者）</figcaption>
</figure>

🎉 衷心感谢我们所有的成员，贡献者和布道师们！是你们的付出让我们的项目得以成功，也是你们让 GreptimeDB 成为一个更优质的产品。让我们一起努力，建立一个更棒的社区！

## PR 亮点

### [db#6505 专为高基数场景优化的 Flat Format（持续推进）](https://github.com/GreptimeTeam/greptimedb/pull/6505)

为高效处理高基数（High-Cardinality）数据场景，我们正在持续推进 Flat Format 的开发：RecordBatch 适配（db#6771，db#6786），范围扫描函数（db#6817）和写入路径集成（db#6866）。

### [db#6752 基于逻辑计划的谓词裁剪 Region](https://github.com/GreptimeTeam/greptimedb/pull/6752)

对无法满足查询谓词的 Region 进行前置裁剪，减少无效扫描并降低查询延迟。

### [db#6777 Metasrv 内部指标持久化至内部表](https://github.com/GreptimeTeam/greptimedb/pull/6777)

该 PR 将关键内部指标落盘为可查询表，便于监控与故障排查。

### [db#6773 OTLP 协议上报支持自定义 Header](https://github.com/GreptimeTeam/greptimedb/pull/6773)

上报时可附加自定义 Header，满足不同部署环境的接入需求，示例如下：

```sql
## Additional OTLP headers, only valid when using OTLP http
[logging.otlp_headers]
Authorization = "Bearer my-token"
Database = "My database"
```

### [db#6809 稀疏主键编码性能提升 235%](https://github.com/GreptimeTeam/greptimedb/pull/6809)

针对稀疏主键场景，我们深入优化了稀疏主键编码路径，将 CPU 开销降低了数倍。

### [db#6816 Remote WAL 引入 Replay Checkpoint 机制](https://github.com/GreptimeTeam/greptimedb/pull/6816)

通过检查点限制启动时的回放量，在最坏情况下也能显著缩短重启时间。

### [db#6764 支持为 Postgres KV Backend 指定 Schema](https://github.com/GreptimeTeam/greptimedb/pull/6764)

新增配置项以设置 Postgres KV Backend 所使用的 Schema。

## Good First Issue

### [Issue#6760 为 OLTP 协议配置 Profile Signal](https://github.com/GreptimeTeam/greptimedb/pull/6760)

关键字：OLTP

难度：简单
