from this site. and it seems to be working.
Go to MenuTools -> Error Console
Paste the following in the “Code:” text-box:
Components.classes["@mozilla.org/browser/nav-history-service;1" ].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");
Press Enter or click Evaluate. The database will thence be vacuumed immediately.