aboutsummaryrefslogtreecommitdiff
path: root/sources/db
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 /sources/db
parente57800a28734f8df747a561d94cdf1ec90ee92d5 (diff)
downloadtaginfo-b869f1464b96427dfad91524a693eeb5dc6f4534.tar
taginfo-b869f1464b96427dfad91524a693eeb5dc6f4534.tar.gz
Add some more stats
Diffstat (limited to 'sources/db')
-rw-r--r--sources/db/post.sql4
1 files changed, 4 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