Vacuum your Firefox databases for better performance
A few days ago I marked an article to read later and I finally read it. It’s about how to Vacuum your Firefox databases for better performance.
According the post, “since Firefox 3.0, bookmarks, history and most storage is kept in SQLite databases”. So, optimize this databases is very healthy to Firefox.
And it’s very easy to do. On Ubuntu (I did on 9.04) install the sqlite3 package. Open the terminal and type:
sudo aptitude install sqlite3
After, still in terminal, access your Firefox profile folder:
cd ~/.mozilla/firefox/something_weird.default
In my computer, this something_weird.default is 73cm0ffy.default.
You can see many .sqlite files inside this folder, these are the database to optimize. To do this, close Firefox (only after read or copy this post
), then type, for each file:
sqlite3 file_name.sqlite vacuum
And there’s a way to vacuum all the files at once? Sure. You’re using a Linux terminal! To do this, type:
for i in *.sqlite; do sqlite3 $i vacuum; done
And done.
| Print article | This entry was posted by Andre Noel on July 27, 2009 at 2:14 am, and is filed under ubuntu. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |




about 2 years ago
Wont :-
“sqlite3 *.sqlite vacuum”
Do the same thing?
about 2 years ago
You really should close firefox before doing this. And in my case, there are *.sqlite files a level below the *.default dir.
I suggest:
find ~/.mozilla/firefox -name \*.sqlite -exec sqlite3 {} vacuum \;about 2 years ago
In my case, I’ve apparently “overused” the browser and it was becoming unsable with all of the disk grinding it was doing. So opening up the terminal was a necessary maintenance task…
about 2 years ago
For OS X users: find ~/Library/Application\ Support/Firefox/Profiles/ -name \*.sqlite -exec sqlite3 {} vacuum \;
about 2 years ago
For Win users:
* Locate the FF Profile dir
* Create a new text file and rename it to ffdbcleanup.bat
* Right click and Edit
* Paste the following code and save the file:
for %%i in (*.sqlite) do (
sqlite3 %%i vacuum
)
* Just run the recently created file (browser closed, of course)
Thank you very much, Andre! It works like a charm!!
NOTE: be sure your sqlite3.exe is in the system path OR copy and paste it in the FF Profile folder before run the .bat
about 2 years ago
Shouldn’t this maintenance action be a button in the Preferences UI, maybe in the Privacy section? Makes sense to me.
about 2 years ago
This is the script i use on ubuntu:
#!/bin/bash
#
# Optimize the firefox sqlite files
#
# Install sqlite3 if not yet installed
if [ -z `which sqlite3` ] ; then
echo "Will now install sqlite3"
sudo apt-get install sqlite3 || {
echo "Installation failed";
exit 1;
};
fi
# Make sure firefox is not running
if [ -n `pidof firefox` ] ; then
echo "Firefox is running. Please close it first";
exit 1;
else
echo "Optimizing firefox databases..."
find ~/.mozilla/firefox -name '*.sqlite' -exec sqlite3 {} vacuum \;
fi
about 2 years ago
An easier way to vacuum Firefox and Liferea’s SQLite databases is using BleachBit, an open source GUI application for various system cleaning tasks.