# Prometheus 3.x、Arrow-PG & BulkMemtable 优化｜Greptime 双周精选 - No. 76 & 77

Source: https://greptime.cn/blogs/2026-02-22-greptimedb-biweekly-report

## 内容概述

*开发周期：2026-01-26 - 2026-02-22*

本期为合并报告，涵盖过去四周的更新。感谢所有贡献者！主要亮点：

- Postgres 协议编码升级到 `arrow-pg`，无符号整数处理更准确
- BulkMemtable 延迟编码在 TSBS 负载下减少约 38% 的 L0 SST 文件
- 写入操作在数据暂存前会校验分区规则版本
- 支持 Prometheus 3.x 的 selector 和 lookback 行为
- 纯元数据的表更新不再无意义地重启 memtable

建议使用旧版本的用户升级以获取上述修复和优化。

我们最重磅的发布是 [v1.0 RC1](/blogs/2026-02-04-greptimedb-v1.0.0-rc1-release) 以及 [GreptimeDB 2026 年路线图](/blogs/2026-02-11-greptimedb-roadmap-2026)，如果你想了解 GreptimeDB 在 2026 年的开发规划和重点方向，这份路线图绝对不容错过！

此外，我们重新设计了 Greptime 官网，整体风格更加简洁，欢迎访问 [greptime.cn](https://greptime.cn/)。

## 贡献者

过去四周，贡献者们共合并了 **58 个 PR**。其中 **3 位独立贡献者**贡献了 **3 个 PR**。
欢迎新贡献者：**[@YZL0v3ZZ](https://github.com/YZL0v3ZZ)**！

独立贡献者：

> - **[@linyihai](https://github.com/linyihai)** *[db#7633](https://github.com/GreptimeTeam/greptimedb/pull/7633)*
> - **[@YZL0v3ZZ](https://github.com/YZL0v3ZZ)** *[db#7673](https://github.com/GreptimeTeam/greptimedb/pull/7673)*
> - **[@ZonaHex](https://github.com/ZonaHex)** *[db#7707](https://github.com/GreptimeTeam/greptimedb/pull/7707)*

## PR 亮点

### [db#7648](https://github.com/GreptimeTeam/greptimedb/pull/7648) [db#7634](https://github.com/GreptimeTeam/greptimedb/pull/7634) 向量索引改进（实验性）

向量索引 metadata 切换到 Protocol Buffers 格式，序列化更可靠，跨版本兼容性更好，同时补充了 sqlness 集成测试。该功能仍在研发中。

### [db#7591](https://github.com/GreptimeTeam/greptimedb/pull/7591) feat: use arrow-pg for postgres data encoding

PostgreSQL 客户端连接现在支持 `IntervalStyle` 配置，无符号整数的处理也更准确了：`uint32` 映射到 `int8`，`uint64` 映射到 `numeric`，避免溢出问题。

### [db#7617](https://github.com/GreptimeTeam/greptimedb/pull/7617) feat: BulkMemtable compact parts without encoding into Parquet

BulkMemtable 现在采用延迟编码来降低 compaction 开销，先在内存中批处理数据，达到可配置的行数或字节阈值后再转换为 Parquet 格式。这个优化在 TSBS 负载下减少了约 38% 的 L0 SST 文件数量，降低了存储放大，写入性能也有提升。

### [db#7628](https://github.com/GreptimeTeam/greptimedb/pull/7628) feat: partition rule version validation for writes and staging

GreptimeDB 现在会在写入时校验分区规则版本，避免分区 schema 变更时数据写错地方。使用过期分区信息的写入请求会被拒绝，确保 schema 变更期间数据也能落到正确的分区里。

### [db#7688](https://github.com/GreptimeTeam/greptimedb/pull/7688) feat: adapt prometheus 3.x selector and lookback behavior

PromQL 查询现在遵循 Prometheus 3.x 的选择器行为，使用起始时间排除的瞬时选择器，修复了 `end` 边界和矩阵选择器的 lookback 处理，返回正确结果。

### [db#7695](https://github.com/GreptimeTeam/greptimedb/pull/7695) fix(mito2): introduce PartitionExprChange in staging flow and keep memtables on metadata-only updates

Region 重分区时修改分区表达式不再重建内存表，避免了不必要的内存操作和潜在的数据丢失。系统现在能区分纯元数据的分区更新和列 schema 变更，让重分区流程更安全高效。

### [db#7626](https://github.com/GreptimeTeam/greptimedb/pull/7626) refactor: remove the RawTableMeta and RawTableInfo to make codes more concise

重构了内部代码，删掉了 `RawTableMeta` 和 `RawTableInfo` 结构，代码更简洁了。用户功能和现有查询操作都没影响。

## Good First Issue

### [Issue#7314](https://github.com/GreptimeTeam/greptimedb/issues/7314) Feature Request: Add built-in daemon mode to keep GreptimeDB running independently of shell sessions

新增 `--daemon` 命令行参数，让 GreptimeDB 能在后台运行，不依赖 shell 会话，会自动处理标准输出/错误重定向和 PID 管理。

关键词：CLI, Daemon, Process Management

难度：Medium

### [Issue#7544](https://github.com/GreptimeTeam/greptimedb/issues/7544) Allow ALTER TABLE to modify the skip_wal option dynamically

支持通过 `ALTER TABLE` 动态修改 `skip_wal` 表选项，可以在运行时开启或关闭预写日志。

关键词：SQL parser, Storage, WAL

难度：Medium
