Skip to content

πŸ› BUG: D1 does not VACUUM causing performance issuesΒ #1618

Open
@matthewjosephtaylor

Description

@matthewjosephtaylor

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:

sqlite3 .wrangler/state/v3/d1/<dbfile>.sqlite
# once opened
VACUUM;
.quit

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    D1D1 DatabasebugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions