[REL] hoover.sh v1.0 (2011-01-08) :: A Free, Open-source Database Cleaner
[REL] hoover.sh v1.0 (2011-01-08)
A Free, Open-source Database Cleaner
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
by Laga Mahesa, aka Stone-D ([email protected], http://www.stone-d.net)
Copyright Laga Mahesa 2011, All Rights Reserved.
Licensed under Creative Commons "by-nc-sa"
Essentially : must attribute, share similarly, for non-commercial use
Detailed Info : http://creativecommons.org/licenses/by-nc-sa/3.0/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This script will do the following :
- scan for any *.db and *.sqlite* files in the current folder and below
- run the VACUUM query on each file
- produce hoover.log ( a textfile documenting hoover's actions )
Why?
Over time, databases (like the Windows Registry) get filled with gaps
where data has been deleted for one reason or another. This gap, if big
enough, will get used by the next - leftover space will go unused.
These spaces result in fragmentation, reduced performance and a larger
than necessary database.
Your mileage may vary.
Applications that frequently move alot of data will benefit from this :
RSS readers (eg Reeder, which uses 3 databases) and most offline reader
apps (eg ReadItLater).
Unless SQLite is running in auto_vacuum=FULL mode, when a large amount
of data is deleted from the database file it leaves behind empty space,
or 'free' database pages. This means the database file might be larger
than strictly necessary.
Running VACUUM to rebuild the database reclaims this space and reduces
the size of the database file.
Frequent inserts, updates, and deletes can cause the database file to
become fragmented - where data for a single table or index is scattered
around the database file. Running VACUUM ensures that each table and
index is largely stored contiguously within the database file. In some
cases, VACUUM may also reduce the number of partially filled pages in
the database, reducing the size of the database file further.
WARNING!
If you are running this on an iDevice, please remember that its memory
has a limited lifespan - such is the nature of flash memory. Don't run
this too often, avoid the urge towards compulsion. Once a week at the
most should be your limit, especially if you're hoovering the iDevice's
entire filesystem.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PS: Don't expect to find anything on my website yet, I'm lazy.
When emailing me, please prefix the subject with "hoover:"
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=