
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):
123 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
August 25, 2009 at 7:27 AM
I’ve just tried this and got an ‘Illegal character’ error message in the error list. Any ideas?
I’m running Firefox 3.5.2
Report Permalinkads
August 25, 2009 at 8:59 AM
those inverted commas with VACUUM need correction – the console doesn’t recognise them.
Report Permalinkgrimsy
August 25, 2009 at 10:02 AM
Had to change the ”VACUUM” to “VACUUM” due to illegal character warnings (different quotation marks).
Report PermalinkEdward Chan
August 25, 2009 at 10:17 AM
Note that the double quote marks around “VACUUM” are the wrong double quotes. They need to be replaced with normal double quotes “, not slanted quotes ”
Report PermalinkJason Fraser
August 25, 2009 at 11:42 AM
The “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.)
Report PermalinkStephen Gore
August 25, 2009 at 12:41 PM
Just FYI – after copying and pasting the URL you’ll need to change
Report Permalink”VACUUM”
to
“VACUUM”
Chris
August 25, 2009 at 1:05 PM
Errored 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.
Report Permalink