# 延迟初始化 Vector builder 让内存占用骤降 90%｜ Greptime 双周精选

Source: https://greptime.cn/blogs/2024-01-23-biweekly

## 内容概述

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

在过去两周中，我们加速推进 v0.6 和 v0.7 的迭代进程，以下是这段时间的总结：
持续优化性能：

- **在 null 值非常多的场景中内存占用可最多下降 90%**
    - **优化读取 parquet 文件的 filter，TSBS 的测试时间可最多降低 50%**

    - **正在为 GreptimeDB 增加 fuzz 测试，以覆盖更多场景**

- **正式开启倒排索引，未来 GreptimeDB 的读性能将会继续提升**

- **完善对 SQL 和 PromQL 的特性支持**

## 社区贡献者名单

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

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

- @[etolbakov](https://github.com/etolbakov) ([db#3147](https://github.com/GreptimeTeam/greptimedb/pull/3147))

- @[lyang24](https://github.com/lyang24) ([db#3076](https://github.com/GreptimeTeam/greptimedb/pull/3076))

- @[tisonkun](https://github.com/tisonkun) ([db#3168](https://github.com/GreptimeTeam/greptimedb/pull/3168) [db#3169](https://github.com/GreptimeTeam/greptimedb/pull/3169) [db#3118](https://github.com/GreptimeTeam/greptimedb/pull/3118) [db#3062](https://github.com/GreptimeTeam/greptimedb/pull/3062))

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

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

## PR 亮点

### [db#3210](https://github.com/GreptimeTeam/greptimedb/pull/3210) 延迟初始化 Vector builder 的时间

在 null 值非常多的场景中，该优化可将 GreptimeDB 的内存占用直线降低 90% 左右，能够极大地提升 GreptimeDB 的空间使用能力。

### [db#3182](https://github.com/GreptimeTeam/greptimedb/pull/3182) 增加用于 fuzz 测试的 create table & alter table sql 的随机生成器

fuzz 测试可以有效帮助 GreptimeDB 提早发现更多 bug。

### [db#3178](https://github.com/GreptimeTeam/greptimedb/pull/3178) 读取 parquet 文件时能够使用更精确的过滤

优化读 parquet 文件的性能，在 TSBS 读性能测试的场景中能够最多减少 50% 的时间成本。

### [db#3164](https://github.com/GreptimeTeam/greptimedb/pull/3164) 支持 COPY DATABASE FROM 语句

配合COPY DATABASE TO 一起使用，方便进行整个 database 的导出和导入。

### [db#3158](https://github.com/GreptimeTeam/greptimedb/pull/3158) 正式开启倒排索引功能

倒排索引可有效提升查询效率。关于 GreptimeDB 的倒排索引介绍请参考 RFC：https://github.com/GreptimeTeam/greptimedb/blob/develop/docs/rfcs/2023-11-03-inverted-index.md

## Good First Issue

### [db##3212](https://github.com/GreptimeTeam/greptimedb/issues/3212)  

帮忙修复 `join_path` 的小 bug，让代码更加优雅。

### [db#3044](https://github.com/GreptimeTeam/greptimedb/issues/3044)

增加对 `MetaPeerClientRef` 的测试，提升 GreptimeDB 的稳定性。

### [db#2931](https://github.com/GreptimeTeam/greptimedb/issues/2931)

`information_schema` 对 GreptimeDB 自身的可观测能力很有用，欢迎一起来完善它。

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