Skip to content

Instantly share code, notes, and snippets.

@Yasushi
Created May 11, 2009 04:27
Show Gist options
  • Save Yasushi/109864 to your computer and use it in GitHub Desktop.
Save Yasushi/109864 to your computer and use it in GitHub Desktop.
DB=$1
if [ "x$DB" == "x" -o ! -f "$DB" ]; then
exit
fi
echo $DB
sqlite3 $DB 'vacuum'
for i in `sqlite3 $DB .schema | grep -o 'INDEX [^ ]*' | sed -e 's/^INDEX \([^ ]*\)/\1/'`
do
echo $i
sqlite3 $DB "reindex $i"
done
echo ...$DB done.
# sqlite3 cookies.sqlite 'create index moz_cookies_hostindex on moz_cookies ( host)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment