# 关闭 WAL 提升写入性能，JSON 解析加速 24% | Greptime 双周精选

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

## 内容概述

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

最近的更新内容如下：

- **支持关闭 WAL 创建表**：新增 `skip_wal = "true"` 选项，允许按表级别关闭 WAL，提高写入性能
- **增强查询分析能力**：`EXPLAIN ANALYZE VERBOSE` 提供更详细的扫表信息
- **NDJSON 解析性能优化**：引入 `simd_json`，JSON 解析速度提升约 24%

## 社区贡献者名单

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

祝贺以下各位在过去 2 周内成为我们最突出的贡献者：

> - @[JackieTien97](https://github.com/JackieTien97)[db-mcp#10](https://github.com/GreptimeTeam/greptimedb-mcp-server/pull/10)
> - @[JetSquirrel](https://github.com/JetSquirrel)[db-mcp#4](https://github.com/GreptimeTeam/greptimedb-mcp-server/pull/4) [db-mcp#2](https://github.com/GreptimeTeam/greptimedb-mcp-server/pull/2) [db-mcp#1](https://github.com/GreptimeTeam/greptimedb-mcp-server/pull/1) 
> - @[yihong0618](https://github.com/yihong0618)[docs#1586](https://github.com/GreptimeTeam/docs/pull/1586)[db#5801](https://github.com/GreptimeTeam/greptimedb/pull/5801)

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

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

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

## PR 亮点

### [db#5740 支持创建关闭 WAL 的表](https://github.com/GreptimeTeam/greptimedb/pull/5740)

允许用户在创建表时通过 `skip_wal = "true"` 配置关闭 Write-Ahead Log (WAL)，适用于对 WAL 可靠性要求不高的场景，提高写入效率。例如：

```sql
CREATE TABLE system_metrics (
     host STRING,
     idc STRING,
     cpu_util DOUBLE,
     memory_util DOUBLE,
     disk_util DOUBLE
     ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
     PRIMARY KEY(host, idc),
     TIME INDEX(ts)
 ) WITH (skip_wal = "true");
```

### [db#5763 支持 `EXPLAIN ANALYZE VERBOSE`](https://github.com/GreptimeTeam/greptimedb/pull/5763)

在单机和分布式模式下支持 `EXPLAIN ANALYZE VERBOSE`，增强查询调试能力。
- 增加 `ExplainOptions`，未来可扩展更多 `EXPLAIN` 选项。
- 在 verbose 模式下提供更详细的扫描器信息，包括：
  - 投影列 (`projection`)
  - 过滤条件 (`filters`)
  - 读取的文件详情（文件 `ID`、时间范围、行数、大小、索引大小）
  - 查询执行的相关指标（输出行数、内存使用、耗时等）

```c++
SeqScan: region=4440996184064(1034, 0), 
partition_count=2 (0 memtable ranges, 2 file 2 ranges), 
projection=["i", "t"], filters=[i > Int32(1)], 
files=[[file=775c368a-140d-4a64-a30b-c72ce23d2e68, 
time_range=(4::Millisecond, 6::Millisecond), 
rows=3, size=2543, index_size=0], [file=5b5024ae-3c95-4945-b1ed-24fd6bb73342, 
time_range=(1::Millisecond, 3::Millisecond), rows=3, size=2543, 
index_size=0]] metrics=[output_rows: 2, mem_used: 224, 
elapsed_await: 3001834, elapsed_poll: 5498708, ]
```

### [db#5794 引入 `simd_json` 优化 NDJSON 解析](https://github.com/GreptimeTeam/greptimedb/pull/5794)

使用 `simd_json` 替换现有的 NDJSON 解析方式，大幅提升 JSON 解析性能。在 JSONBench 场景下解析 **10 × 100M** 数据的耗时：

- 优化前：49,502 ms
- 优化后：37,620 ms （加速约 24%）

## Good First Issue

### [db#5120 添加向量函数 `JSON_TO_VEC` 和 `VEC_TO_JSON`](https://github.com/GreptimeTeam/greptimedb/pull/5120)

`JSON_TO_VEC`：将 JSON 数组转化为向量；`VEC_TO_JSON`：将向量转化为 JSON 数组。

- 难度：中等
- 关键字：向量

---
## 关于 Greptime

[Greptime 格睿科技](https://greptime.cn/)专注于为可观测、物联网及车联网等领域提供实时、高效的数据存储和分析服务，帮助客户挖掘数据的深层价值。目前基于云原生的时序数据库 [GreptimeDB](https://github.com/GreptimeTeam/greptimedb) 已经衍生出多款适合不同用户的解决方案，更多信息或 demo 展示请联系下方小助手（微信号：greptime）。

欢迎对开源感兴趣的朋友们参与贡献和讨论，从带有 good first issue 标签的 issue 开始你的开源之旅吧～期待在开源社群里遇见你！添加小助手微信即可加入“技术交流群”与志同道合的朋友们面对面交流哦~

Star us on GitHub Now: https://github.com/GreptimeTeam/greptimedb

官网：https://greptime.cn/

文档：https://docs.greptime.cn/

Twitter: https://twitter.com/Greptime

Slack: https://greptime.com/slack

LinkedIn: https://www.linkedin.com/company/greptime/
