
All-things-Firefox weblog Mozilla Links previously detailed how to defragment SQLite databases with a vacuum command, but the whole process was a bit clumsy, and it required a restart. Now they’ve updated the technique with a simple bit of code you can run inside Firefox’s Error Console that requires no restart.
- Open the Error Console: Tools menu/Error Console
- In the Code text box paste this (it’s a single line without spaces, not three lines as shown below):
Components.classes["@mozilla.org/browser/nav-history-service;1"] . getService(Components.interfaces.nsPIPlacesDatabase). DBConnection.executeSimpleSQL("VACUUM");- Press Evaluate. All the UI will freeze for a few seconds while databases are VACUUMed
Once the process is complete, you should notice a big improvement in performance, especially when using the Awesome Bar to search for a web site. While you’re tweaking away, you may also want to take a look at how you can speed up Firefox by limiting your history size.
Vacuum Firefox databases for better performance, now with no restart [Mozilla Links]




















James
Tuesday, August 25, 2009 at 7:27 AMI’ve just tried this and got an ‘Illegal character’ error message in the error list. Any ideas?
I’m running Firefox 3.5.2
ads
Tuesday, August 25, 2009 at 8:59 AMthose inverted commas with VACUUM need correction – the console doesn’t recognise them.
grimsy
Tuesday, August 25, 2009 at 10:02 AMHad to change the ”VACUUM” to “VACUUM” due to illegal character warnings (different quotation marks).
Edward Chan
Tuesday, August 25, 2009 at 10:17 AMNote that the double quote marks around “VACUUM” are the wrong double quotes. They need to be replaced with normal double quotes “, not slanted quotes ”
Jason Fraser
Tuesday, August 25, 2009 at 11:42 AMThe “curly” quotes around the VACUUM in the command above should be changed to “normal” quotes, otherwise the command won’t work (you’ll get an “illegal character” error message in the error console.)
Stephen Gore
Tuesday, August 25, 2009 at 12:41 PMJust FYI – after copying and pasting the URL you’ll need to change
”VACUUM”
to
“VACUUM”
Chris
Tuesday, August 25, 2009 at 1:05 PMErrored out for me until I removed the space and hash at the start and replaced the quotes around VACUUM with standard quote marks…….even then I am not sure it did anything since I didn’t get any messages after hitting evalutate.