Compacting db in FF from error console

atcroft on 2009-09-18T23:24:07

(This is mostly for my own reference, because at one time I had encountered the information, but forgot where I stored it.)

To compact the database used by FireFox 3.x from the Error Console,

  1. Go to Tools -> Error Console
  2. Paste in (as a single line) the following:
    Components.classes[ "@mozilla.org/browser/nav-history-service;1" ].getService( Components.interfaces.nsPIPlacesDatabase ).DBConnection.executeSimpleSQL( "VACUUM" );

(Many thanks to the folks on #firefox on irc.mozilla.org, and especially to dr|z3d, who was able to quickly offer me with clue in this instance.)


Awesome!

Aristotle on 2009-09-19T14:12:56

Thanks for posting that.

Alternatively...

bart on 2009-09-19T19:40:03

With the SQLite Manager FF extension, you can open its dialog window, select each of the Firefox databases in turn (they are all listed by default), and click on the "compact database" menu item, in the "database" menu.

And you don't need to remember anything.