Intrepid Blog has a blog post about how to optimize Mac’s popular mail app sparrow.app’s sparrowdb data file size.
Good to know that sparrow is using tokyo-cabinet. And it sounds like a great way to optimize tha data file safely.
Please quite sparrow.app before you run this.
But when I run:
tchmgr optimize ~/Library/Application\ Support/Sparrow/my.email.account.sparrowdb/data.db/data.tch
I got this error:
tchmgr: ~/Library/Application\ Support/Sparrow/my.email.account.sparrowdb/data.db/data.tch: 6: invalid record header
After a googling, I found the parameter
-nl should fix it.
So I tried run this command again:
tchmgr optimize -nl ~/Library/Application\ Support/Sparrow/my.email.account.sparrowdb/data.db/data.tch
now it fix the db and renamed the original file with a temporary name:
Please open Sparrow to check if the db is OK. If you can see your message then you can delete the .broken file. Otherwise, please copy the borken file back.
In my case it do reduced the db size:
-rw-r--r-- 1 tin staff 1.7G Aug 21 13:12 data.tch -rw-r--r-- 1 tin staff 2.6G Aug 21 13:14 data.tch.tmp.1209295.broken
Unfortunetely I saw some message can’t be rendered anymore, so I copy that db back again.
If the db is borken and can’t be recovered, Sparrow has a official way to reset a local cache and synching that again. Just delete the Info.plist file in your sparrwodb folder.