# PromQL 查询提速 100x，全文索引新增 Bloom 后端优化存储效率｜Greptime 双周精选

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

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

最近的更新内容如下：

- **全文索引多后端支持**：全文索引新增 Bloom 后端，支持 `matches_term` 函数实现精准术语匹配
- **流引擎新增批处理模式**：新增基于时间窗口的处理支持，实现批处理数据流
- **PromQL 性能重大提升**：查询执行效率提升 100 倍，内存占用降低 40%

## 社区贡献者名单

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

祝贺以下各位在过去 2 周内成为我们最突出的贡献者：
 
> 注：按照 GitHub 用户名首字母顺序排列
> - @*[soisyourface](https://github.com/soisyourface)* **[db#5829](https://github.com/GreptimeTeam/greptimedb/pull/5829)** 
> - @*[yihong0618](https://github.com/yihong0618)* **[db#5890](https://github.com/GreptimeTeam/greptimedb/pull/5890)**

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

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

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

## PR 亮点

### [db#5806](https://github.com/GreptimeTeam/greptimedb/pull/5806) [db#5817](https://github.com/GreptimeTeam/greptimedb/pull/5817) [db#5843](https://github.com/GreptimeTeam/greptimedb/pull/5843) [db#5845](https://github.com/GreptimeTeam/greptimedb/pull/5845) [db#5869](https://github.com/GreptimeTeam/greptimedb/pull/5869) [db#5896](https://github.com/GreptimeTeam/greptimedb/pull/5896) [db#5886](https://github.com/GreptimeTeam/greptimedb/pull/5886) 全文索引多后端支持

本系列 PR 实现了全文索引的多后端支持（Bloom 和 Tantivy），新增 `matches_term` 函数用于术语匹配，并优化了匹配性能。

使用示例：

```sql
-- 创建表时指定全文索引后端
CREATE TABLE logs (
  ...
  text_column STRING FULLTEXT INDEX WITH (backend='bloom'),
  ...
);

-- 使用 `matches_term` 进行术语匹配
SELECT * FROM logs WHERE matches_term(text_column, 'foo');
```

### [db#5807](https://github.com/GreptimeTeam/greptimedb/pull/5807) [db#5881](https://github.com/GreptimeTeam/greptimedb/pull/5881) 流式批处理引擎

该引擎实现了数据流的批处理模式，支持基于时间窗口的计算和流任务管理。

### [db#5691](https://github.com/GreptimeTeam/greptimedb/pull/5691) [db#5859](https://github.com/GreptimeTeam/greptimedb/pull/5859) [db#5863](https://github.com/GreptimeTeam/greptimedb/pull/5863) PromQL 执行性能优化

本系列优化显著提升了 PromQL 引擎的执行效率：

- **100 倍**速度提升，内存占用降低 **40%**（通过消除冗余排序并引入并行计算）
- 复杂查询的范围操作提速 **10 倍**
- 减少重复 `NOT NULL` 过滤计算，性能提升 **2 倍**

### [db#5847 单分区查询的 `SELECT DISTINCT` 下推](https://github.com/GreptimeTeam/greptimedb/pull/5847)

当查询仅涉及单个分区时，将 `SELECT DISTINCT` 下推至 Region 层级执行，提升去重查询性能。

### [db#5820 支持 `REPLACE INTO` 语句](https://github.com/GreptimeTeam/greptimedb/pull/5820)

新增兼容 MySQL 语法的 `REPLACE INTO` 支持，允许单条语句实现插入或替换数据。

## Good First Issue

### [Issue#5853 在配置文件中增加 `--user-provider` 配置项](https://github.com/GreptimeTeam/greptimedb/pull/5853)

在 `config.toml` 中新增 `--user-provider` 配置项，使其功能与现有命令行选项保持一致。

- 难度：简单
- 关键字：配置

---
## 关于 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/
