blob: 00827c45b07213290761d33092541c5d942d258b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
Our friend Reid sent us a handy tip for speeding up Apple's mail.app over the weekend. The trick is the force optimize the SQLite database that Mail uses to reference messages and metadata.
As with any database, Mail's reference tables can get bloated over time, but this line of code will slim things down. Quit Mail.app and then open up the Terminal and enter this line (be sure to back up your ~/Library/Mail folder before proceeding):
sqlite3 ~/Library/Mail/Envelope\ Index vacuum;
Assuming you haven't moved your Mail data from the default location, that line should optimize Mail's SQLite data and possibly speed things up a but.
The SQL [docs for the vacuum command][1] say:
>The VACUUM command cleans the main database by copying its contents to a temporary database file and reloading the original database file from the copy. This eliminates free pages, aligns table data to be contiguous, and otherwise cleans up the database file structure.
I can't say how safe this is, neither of us had any problems, but YMMV. Remember to quit Mail.app first and back up your ~/Library/Mail folder before running the command just to be on the safe side.
If you'd like to find out just how much space you're saving run this command, which will output your index file size in megabytes, before and after the optimization command:
ls -lh ~/Library/Mail/Envelope\ Index
That .
Many thanks to Reid.
[1]: http://www.sqlite.org/lang_vacuum.html "SQLite Docs: Vacuum"
|