cloudflare / cloudflare/workerd
🐛 BUG: D1 does not VACUUM causing performance issues
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
### Which Cloudflare product(s) does this pertain to?
D1
### What version(s) of the tool(s) are you using?
3.25.0
### What version of Node are you using?
20.9.0
### What operating system and version are you using?
Mac Darwin Kernel Version 23.0.0
### Describe the Bug
### Observed behavior
D1 gets slower and slower as I use as I do a lot of inserts and deletes. the sqlite DB file inside .wrangler seems to grow endlessly
### Expected behavior
sqlite auto vacuum should probably be enabled.
### Steps to reproduce
Insert a lot of data into D1 db
delete a lot of rows from D1 db
Note that the size of the sqlite file on disk does not reduce.
Work-around:
```bash
sqlite3 .wrangler/state/v3/d1/.sqlite
# once opened
VACUUM;
.quit
```
### Please provide a link to a minimal reproduction
_No response_
### Please provide any relevant error logs
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.