====== Optimize your Firefox sqlite data ======
Firefox uses [[wp>sqlite]] to store many data. Like bookmarks, cookies, etc. But it doesn't provide a direct option to re-index these data, which is a feature of sqlite3 and eady job. One will need [[man>sqlite]] executable to perform the task yourself.
So in sqlite:
sqlite3 datafile VACUUM;
sqlite3 datafile REINDEX;
Will re-index the datafile and slightly boot firefox performance after a certain period.
==== Scripts ====
In bash with unix utils:
find ~/.mozilla -type f -name "*.sqlite" -exec sqlite3 {} VACUUM \;
find ~/.mozilla -type f -name "*.sqlite" -exec sqlite3 {} REINDEX \;
In windows, which lacks command-line automation. You might need to run sqlite commands one file-by-one. But, with [[http://gnuwin32.sourceforge.net/|gnuwin32]], one can do regular shell jobs in windows cmd.exe:
ls -1 *.sqlite | sed "s/\(.*\)/sqlite3 &1\ VACUUM;/g" > indexer.bat
ls -1 *.sqlite | sed "s/\(.*\)/sqlite3 &1\ REINDEX;/g" >> indexer.bat
This prepares the indexer.bat for your use. 8-)
==== Updated ====
Well, Thunderbird also need this... So I have this run on Windows startup:
cd E:\portable\FirefoxPortable
find -type f -name "*.sqlite" | sed "s/\(.*\)/sqlite3 &1\ VACUUM;/g" > indexer.bat
find -type f -name "*.sqlite" | sed "s/\(.*\)/sqlite3 &1\ REINDEX;/g" >> indexer.bat
call indexer.bat
cd E:\portable\ThunderbirdPortable
find -type f -name "*.sqlite" | sed "s/\(.*\)/sqlite3 &1\ VACUUM;/g" > indexer.bat
find -type f -name "*.sqlite" | sed "s/\(.*\)/sqlite3 &1\ REINDEX;/g" >> indexer.bat
call indexer.bat
{{tag>web db}}
{{page>:widgets:ad_banner_1&nofooter&noeditbtn}}
~~META:
creator = MeaCulpa
&date created = 2010-01-27
~~
~~LINKBACK~~
~~DISCUSSION~~