# Metric 引擎死锁修复与 SHOW TABLES 性能优化｜Greptime 双周精选 - No. 71

Source: https://greptime.cn/blogs/2025-12-08-greptimedb-biweekly-report

## 内容概述

GreptimeDB 作为一个持续成长的开源项目，离不开全球社区贡献者的支持，感谢大家！

近期主要更新：

- 支持 Database 级别 compaction 参数配置
- 修复 Metric 引擎 schema 变更时的死锁问题
- 优化大量表场景下 SHOW TABLES 的查询性能

**推荐升级至 [`v1.0.0-beta.2`](/blogs/2025-12-03-greptimedb-v1-beta2-release)** 以获取上述改进！

## 贡献者

过去两周，社区共合并 **70 个 PR**，其中 **5 位独立贡献者**参与贡献。

本期活跃贡献者：

> - @**[WaterWhisperer](https://github.com/WaterWhisperer)** *[db#7240](https://github.com/GreptimeTeam/greptimedb/pull/7240) [db#7251](https://github.com/GreptimeTeam/greptimedb/pull/7251) [db#7236](https://github.com/GreptimeTeam/greptimedb/pull/7236)*
> - @**[SNC123](https://github.com/SNC123)** *[db#7104](https://github.com/GreptimeTeam/greptimedb/pull/7104)*

欢迎新贡献者 @**[McKnight22](https://github.com/McKnight22)** 加入，为 COPY TO 命令添加了 GZIP、BZIP2、XZ、ZSTD 压缩格式支持。

👏 感谢所有贡献者的付出！正是你们让 GreptimeDB 变得更好。期待与大家一起构建更强大的社区！

## PR 亮点

### [db#7231 优化大表场景 SHOW TABLES 性能](https://github.com/GreptimeTeam/greptimedb/pull/7231)

表元数据查找从线性遍历改为二分查找，显著提升 SHOW TABLES 执行效率，同时降低第三方客户端首次连接的延迟。

### [db#7251 支持 Database 级别 compaction 参数配置](https://github.com/GreptimeTeam/greptimedb/pull/7251)

GreptimeDB 中的表在未显式配置 compaction 参数时，会继承 Database 级别的配置。本 PR 新增 `ALTER DATABASE [database_name] SET [compaction_param_name]=[compaction_param_value]` 语法，支持修改 Database 级别的 compaction 参数。

### [db#7308 修复 Metric 引擎 schema 变更死锁](https://github.com/GreptimeTeam/greptimedb/pull/7308)

Metric 引擎支持根据写入数据自动触发 schema 变更。本 PR 修复了批量 schema 变更时因锁获取顺序不一致导致的死锁问题。

### [db#7252](https://github.com/GreptimeTeam/greptimedb/pull/7252) [db#7260](https://github.com/GreptimeTeam/greptimedb/pull/7260) [db#7263](https://github.com/GreptimeTeam/greptimedb/pull/7263) [db#7296 GC Worker 即将上线](https://github.com/GreptimeTeam/greptimedb/pull/7296)

GC Worker 提供全局文件生命周期管理能力，自动清理孤立文件，同时避免误删仍被引用的过期文件。该功能开发进展顺利，将随 GreptimeDB 1.0 正式发布。详情参考 [GC Worker RFC](https://github.com/GreptimeTeam/greptimedb/blob/main/docs/rfcs/2025-07-23-global-gc-worker.md)。

## Good First Issue

### [Issue#7179 在自监控指标中暴露时间线统计信息](https://github.com/GreptimeTeam/greptimedb/issues/7179)

在 GreptimeDB 自监控指标中增加时间线相关统计，便于外部监控系统接入。

关键字：指标监控、可观测性

难度：简单

### [Issue#6334 支持 KILL 终止 INSERT INTO SELECT 查询](https://github.com/GreptimeTeam/greptimedb/issues/6334)

扩展 `KILL` 命令对 `INSERT INTO SELECT` 查询的支持。

关键字：查询引擎

难度：中等
