From d9e4bdff695eedf95696c3892a83e66328f5c4cf Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 15 Oct 2011 23:20:45 +0200 Subject: Integrate statistics handler, only us one db Better integrate the statistics handler. It now uses the same database as the tagstats handler (typically taginfo-db.db). The database is now given on the command line. This simplifies the scripts calling tagstats. --- sources/db/post.sql | 4 ---- sources/db/update.sh | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'sources/db') diff --git a/sources/db/post.sql b/sources/db/post.sql index c3486bb..bdd0fb7 100644 --- a/sources/db/post.sql +++ b/sources/db/post.sql @@ -12,10 +12,6 @@ PRAGMA count_changes = OFF; PRAGMA temp_store = MEMORY; PRAGMA cache_size = 5000000; -ATTACH DATABASE '__DIR__/count.db' AS count; -INSERT INTO stats SELECT * FROM count.stats; -DETACH DATABASE count; - CREATE UNIQUE INDEX keys_key_idx ON keys (key); CREATE INDEX tags_key_idx ON tags (key); -- CREATE UNIQUE INDEX tags_key_value_idx ON tags (key, value); diff --git a/sources/db/update.sh b/sources/db/update.sh index 4d10894..24e7f57 100755 --- a/sources/db/update.sh +++ b/sources/db/update.sh @@ -29,7 +29,6 @@ echo "`$DATECMD` Start db..." DATABASE=$DIR/taginfo-db.db rm -f $DATABASE -rm -f $DIR/count.db echo "`$DATECMD` Running init.sql..." sqlite3 $DATABASE <../init.sql @@ -46,17 +45,14 @@ left=`../../bin/taginfo-config.rb geodistribution.left` width=`../../bin/taginfo-config.rb geodistribution.width` height=`../../bin/taginfo-config.rb geodistribution.height` -HERE=`pwd` -cd $DIR -#valgrind --leak-check=full --show-reachable=yes $HERE/tagstats $PLANETFILE >valgrind.log 2>&1 -$HERE/tagstats --left=$left --bottom=$bottom --top=$top --right=$right --width=$width --height=$height $PLANETFILE -cd $HERE +#valgrind --leak-check=full --show-reachable=yes $DIR/tagstats $PLANETFILE $DATABASE >valgrind.log 2>&1 +$DIR/tagstats --left=$left --bottom=$bottom --top=$top --right=$right --width=$width --height=$height $PLANETFILE $DATABASE echo "`$DATECMD` Running update_characters... " ./update_characters.pl $DIR echo "`$DATECMD` Running post.sql... " -perl -pe "s|__DIR__|$DIR|" post.sql | sqlite3 $DATABASE +sqlite3 $DATABASE