Mac OS X Hints Weblog: A possible fix for a slow Mail app
Posted 08 March 2007 - 04:05 PM
Those ghosts are still with me after two years, part of the fire-wire brain transplant from my G3 laptop to my MacBookPro. I tried all but the kookiest notions on Apple's Support discussion board. Then I called Apple Support, who recommended a clean-slate re-install. No, thanks, I'll tolerate a few ghosts.
Cleaning up the envelop index confined the ghosts to a single mail account. I'll be deleting that account in about five months. I hope the ghosts will go with it.
Posted 08 March 2007 - 04:56 PM
I just switched to Mail to check and could not find the problem aynore, although visiting many of my 161 mailboxes/folders caused a problem as they stopped displaying any messages at all after a while. I restarted Mail and all was okay.
I am wondering if 161 mailboxes/folders and perhap 20,000 messages is straining the database. btw-- I need to keep emails with clients going back to year 2000 and need them quickly accessible, hence the large number.
Posted 08 March 2007 - 06:16 PM
I now also perform this regularly via applescript and iCal.
Posted 08 March 2007 - 08:34 PM
1. The "Envelope Index" file isn't just the sqlite database's index: it's the entire database.
2. The word "index" at the end of the command you type in Terminal is unnecessary. sqlite3 ignores parameters to the 'vacuum' command. (http://www.sqlite.org/langvacuum.html)
3. All this does is make the database file smaller. That's it. It doesn't change the information in the database in any way. You'll get faster performance due to less I/O as Mail reads the database, because the records are closer together; but this can't possibly fix problems like "ghost messages". If you have such problems, the Rebuild Mailbox command, or throwing out the entire Envelope Index file, may be called for.
4. Likewise, doing this will not_ cause Mail to lose or re-download attachments. Again, rebuilding the mailbox or deleting the database would cause this to happen, but mere vacuuming won't.
And in response to a question above, this can help with any type of Mail account, since all messages are stored in the database, no matter what type of account they're from.
Posted 08 March 2007 - 09:23 PM
I haven't spoken to them directly, but I somehow suspect IMAP is involved, and their is then some sort of failure to re-read the file from the server. But there are enough comments that I think the problem is legit.
As for the index bit at the end of the Terminal command, I just used what was posted at Hawk Wings, so it's quite possibly redundant /forums/ubbthreads/images/graemlins/smile.gif
Posted 09 March 2007 - 07:50 AM
Thanks for the clarificatons, but I have to disagree with one point: there are multiples of users who ahve reported lost mail after redoing their indexes. You can read some of the comments on the original macosxhints entry if you want.
This could easily happen if the database file itself was corrupted somehow, as the vacuum command works by building a new copy of the database from the data currently in it. If the index structure was damaged, or if there are bad blocks in the database, it's quite likely that you'd lose information. That said, those reporting a problem may already have lost messages (but not noticed), and only spotted the problem after using this tip.
Anyway, this is a great tip; it's made my copy of Mail go much faster.
Posted 09 March 2007 - 09:52 PM
sqlite3 ~/Library/Mail/Envelope Index vacuum;
Posted 12 July 2007 - 12:58 AM
What is "python" and why was it running?
Posted 11 July 2009 - 09:37 AM
Posted 27 July 2011 - 08:29 AM