Thanks to Mozilla’s Jeremy Orem, we have now learned it can be done from within Firefox in 3 short steps:
2. In the Code text box paste this (it’s a single line):
Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");
3. Press Evaluate. All the UI will freeze for a few seconds while databases are VACUUMed.Also, there is a new experimental Firefox addon which makes this process more comfortable by providing the means to run the database optimization with a single click. The will optimize the SQLite databases of the active Firefox profile whenever its button in the Firefox status bar is pressed.
[via ghacks & mozilla links]