aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-19 12:43:52 +0100
committerJochen Topf <jochen@topf.org>2013-01-19 12:43:52 +0100
commitb869f1464b96427dfad91524a693eeb5dc6f4534 (patch)
tree612d3f21488049196fb69bcc74f6b099d260cf44
parente57800a28734f8df747a561d94cdf1ec90ee92d5 (diff)
downloadtaginfo-b869f1464b96427dfad91524a693eeb5dc6f4534.tar
taginfo-b869f1464b96427dfad91524a693eeb5dc6f4534.tar.gz
Add some more stats
-rw-r--r--sources/db/post.sql4
-rw-r--r--sources/wiki/post.sql8
2 files changed, 12 insertions, 0 deletions
diff --git a/sources/db/post.sql b/sources/db/post.sql
index 6a25f4a..0edba18 100644
--- a/sources/db/post.sql
+++ b/sources/db/post.sql
@@ -72,9 +72,13 @@ INSERT INTO prevalent_values (key, value, count, fraction)
CREATE INDEX prevalent_values_key_idx ON prevalent_values (key);
+INSERT INTO stats (key, value) SELECT 'relation_types_with_detail', count(*) FROM relation_types;
INSERT INTO relation_types (rtype, count) SELECT value, count_relations FROM tags WHERE key='type' AND count_relations > 0 AND value NOT IN (SELECT rtype FROM relation_types);
+INSERT INTO stats (key, value) SELECT 'relation_types', count(*) FROM relation_types;
+INSERT INTO stats (key, value) SELECT 'relation_roles', count(*) FROM relation_roles;
+
INSERT INTO prevalent_roles (rtype, role, count, fraction)
SELECT t.rtype, r.role, r.count_all, round(CAST(r.count_all AS REAL) / CAST(t.members_all AS REAL), 4) FROM relation_types t, relation_roles r
WHERE t.rtype = r.rtype
diff --git a/sources/wiki/post.sql b/sources/wiki/post.sql
index 9cd6b14..16d02ce 100644
--- a/sources/wiki/post.sql
+++ b/sources/wiki/post.sql
@@ -27,6 +27,8 @@ INSERT INTO wikipages_tags (key, value, langs, lang_count) SELECT key, value, gr
INSERT INTO wiki_languages (language, count_pages) SELECT lang, count(*) FROM wikipages GROUP BY lang;
+INSERT INTO stats (key, value) SELECT 'wiki_images', count(*) FROM wiki_images;
+
INSERT INTO stats (key, value) SELECT 'wiki_keys_described', count(*) FROM wikipages_keys;
INSERT INTO stats (key, value) SELECT 'wiki_pages_for_keys', count(*) FROM wikipages WHERE value IS NULL;
INSERT INTO stats (key, value) SELECT 'wiki_pages_for_keys_redirect', count(*) FROM wikipages WHERE value IS NULL AND status='r';
@@ -41,6 +43,12 @@ INSERT INTO stats (key, value) SELECT 'wiki_pages_for_tags_without_template', co
INSERT INTO stats (key, value) SELECT 'wiki_pages_for_tags_with_template', count(*) FROM wikipages WHERE value IS NOT NULL AND status='t';
INSERT INTO stats (key, value) SELECT 'wiki_pages_for_tags_with_error', count(*) FROM wikipages WHERE value IS NOT NULL AND status='e';
+INSERT INTO stats (key, value) SELECT 'wiki_pages_for_relation_types', count(*) FROM relation_pages;
+INSERT INTO stats (key, value) SELECT 'wiki_pages_for_relation_types_redirect', count(*) FROM relation_pages WHERE status='r';
+INSERT INTO stats (key, value) SELECT 'wiki_pages_for_relation_types_without_template', count(*) FROM relation_pages WHERE status='p';
+INSERT INTO stats (key, value) SELECT 'wiki_pages_for_relation_types_with_template', count(*) FROM relation_pages WHERE status='t';
+INSERT INTO stats (key, value) SELECT 'wiki_pages_for_relation_types_with_error', count(*) FROM relation_pages WHERE status='e';
+
INSERT INTO stats (key, value) SELECT 'wiki_languages', count(*) FROM wiki_languages;
ANALYZE;