Vacumming your Address Book

Apple’s a big fan of SQLite (which is awesome, because SQLite is awesome).  It’s used for a ton of things, including the data store for Address Book.

Like most databases, however, SQLite dbs need to be VACUUM’d from time to time.  Without going into too much detail, one can think of a VACUUM as a defragmentation operation for the database.  Without it, the SQLite db can get a little bloated and large and things might start to slow down.  Here’s how to fix it:

First, drop into Terminal and cd to the AddressBook Application Support directory

$  cd ~/Library/Application Support/AddressBook

Next, BACKUP YOUR ADDRESS BOOK!!!!!

$ cp AddressBook-v22.abcddb AddressBook-v22.abcddb.backup

Fire up sqlite and VACUUM away.

$ sqlite3 AddressBook-v22.abcddb

SQLite version 3.6.18
Enter “.help” for instructions
Enter SQL statements terminated with a “;”
sqlite>VACUUM;

sqlite>exit;

All done!  Your AddressBook should be smaller and things should be a bit zippier.