Posts Tagged ‘SQL’

Reignite your Firefox [Update]

Saturday, May 2nd, 2009

I’ve just read a great tip on Firefox performance by Nick Anderson that I wanted to share with you: Newer versions of Firefox store all its data in so-called SQLite databases. SQLite is an ACID compliant relational database engine that consists of one flat file and is meant for storing data of single-user applications. The problem with these SQLite database files is that they get cluttered over time. Luckily, there’s a statement to clean up an SQLite database: The VACUUM statement. Just close all Firefox instances, backup your profile and run the following shell code:

  1. for i in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $i VACUUM;done;

VoilĂ . Depending on how long you use your profile, the performance increase will be really significant. And don’t think of filing a bug report. There are already plenty of it.

Update: Jeremy Orem recently posted on how you can clean your SQLite databases without shutting down the browser:

  1. Select Error Console from the Tools menu.
  2. Paste the following in the Code text-box:
    Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM")
  3. Press Enter

The user interface may freeze for a second while the vacuuming takes place.