diff options
author | Jochen Topf <jochen@topf.org> | 2011-10-15 23:20:45 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2011-10-15 23:20:45 +0200 |
commit | d9e4bdff695eedf95696c3892a83e66328f5c4cf (patch) | |
tree | 5ade7ec21c1b8b7bd2fb5cb69fbd4b28c0aeb4f8 /sources/db | |
parent | c9b9a1b03efa73e28fb8929272d464c1684e9d8f (diff) | |
download | taginfo-d9e4bdff695eedf95696c3892a83e66328f5c4cf.tar taginfo-d9e4bdff695eedf95696c3892a83e66328f5c4cf.tar.gz |
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.
Diffstat (limited to 'sources/db')
-rw-r--r-- | sources/db/post.sql | 4 | ||||
-rwxr-xr-x | sources/db/update.sh | 10 |
2 files changed, 3 insertions, 11 deletions
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 <post.sql echo "`$DATECMD` Done db." |