Login

RyanHerbert.com


Speed up slow Firefox 3 History search

Posted on Thu Jan 08, 2009 by Ryan

I've been using Firefox 3.0 since beta and its been a reasonably painless experience.  One thing that always annoyed me though is that as time went on, the history search function of Firefox got slower and slower.  Even worse, Firefox blocked the UI and even stopped current downloads when searching the history.

With the release of Firefox 3.0, Firefox switched to storing your history and other user data in SQLite files.  I assumed that the delay was caused by the shear size of the database, so I cut my history down from the default of 90 days to 30, but that hardly made any difference.

I set off to find other ways to optimize the databases, and long story short, the trick is to vacuum your databases to remove deleted entries and basically rebuild your tables and indexes.

First you'll need to head to the SQLite downloads page and download the command line client.  Drop the exe file somewhere in your PATH (c:\windows will work for a quick and easy fix).

Create a .bat file with the line

for %%i in (*.sqlite) do @echo VACUUM; | sqlite3 %%i

and drop the bat file in C:\Documents and Settings\(User)\Application Data\Mozilla\Firefox\Profiles\(your profile)\

Run the bat file and sqlite will go about recreating your tables, which may take some time.  Afterwards, you should see a significant difference in the speed of your history search.


Ryan Herbert

is a 27 year old software developer from Lake Charles, LA.


Search