cloudflare / cloudflare/workerd

🐛 BUG: D1 does not VACUUM causing performance issues

Open
#1,618 6 comments 0 reactions 0 assignees View on GitHub
bug D1
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.