Records.db too big?

 atuin history list | wc -l
56457
ll *db
.rw-------  62Mi sedlund 20 minutes  history.db
.rw-------  24Ki sedlund 3 weeks     kv.db
.rw------- 210Mi sedlund 6 minutes   records.db
.rw-------  32Ki sedlund 3 weeks     scripts.db

I deleted a bunch of dupes and when doing records grew larger.

I ran vacuum on records.db , didnt change much.

Is this size expected?

the records.db is now upto 256MB .

Should i export my history and make a new account and reimport?

It seems there no way to clear this up.

I think that’s probably best for now. We don’t have anything for trimming the record store.

Running deletions will always increase the size of records - it needs to record that fact that xyz was deleted, so that it can be synced with all current + future machines

I’d like to work on cleanup here, but my records.db with >120k lines of history (and a bunch of things that aren’t history) is still barely ~80mb.

Have you been doing a lot of deleting/de-duping?

Yes both, seeing if that would reduce the size of records.db, but then realizing its a complete sync history.

Thanks for the confirmation!

1 Like

Here is the process I used which cut my records.db on each machine down from 258MB to 60MB

# pick a primary node to start with
cd ~/.local/share/atuin

# set account_sync = false in ~/.config/atuin/config.toml on all nodes

# make a backup
cp history.db history.db.bak

atuin account delete

# clean up your history

## delete any entry that didnt exit 0 before a month ago

# atuin search -b "1 month ago" --exclude-exit 0 --delete-it-all

## remove duplicates older than x months

# atuin history dedup -b "3 months ago" --dupkeep 1

# verify you have a history size that you find acceptable

atuin history list | wc -l

# remove old session, key and records.db
rm records.db* key session

# create a new account
# use new username and email (plus addressed).  fails if existing email
atuin account register

# verify.  there will be the previous commands from above that are encrypted with an old key

atuin store verify

# purge the few old keyed entries
atuin store purge

# sync new records.db to server
atuin sync

# get your new key
atuin key

# set account_sync = true in ~/.config/atuin/config.toml the initial node

# on the other machines
cd ~/.local/share/atuin
atuin account logout
rm history.db* records.db* key session
atuin login
# clean up local records
atuin store verify
atuin store purge
# set account_sync = true in ~/.config/atuin/config.toml
1 Like