# agent: Reduce DB load in ThreadMetadataStore \(\#52313\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a667d9c718f3bf48e042c2d1a737d9d5eadabd73)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a667d9c718f3bf48e042c2d1a737d9d5eadabd73

Requested commit: a667d9c718f3bf48e042c2d1a737d9d5eadabd73

Commit: a667d9c718f3bf48e042c2d1a737d9d5eadabd73

Tree: d6e1df31f4771eac1059ed86b28d3ddffbfe9b98

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Reduce DB load in ThreadMetadataStore (#52313)

## Context

We now batch multiple db operations together if they happen very
frequently (similar to how we handle it in `thread_history.rs`)

## Self-Review Checklist

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

---------

Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
```

## Parents

- [d09cc535274c6a7dce94e5b735262eb350510ef5](https://git.cafe/gitcafe/zed/commit/d09cc535274c6a7dce94e5b735262eb350510ef5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a667d9c718f3bf48e042c2d1a737d9d5eadabd73?format=markdown)
