From: Bob Cotton Date: Fri, 1 May 2009 18:28:52 +0000 (-0600) Subject: Changed the partition by just to use the fk on the dimension tables. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=collectd_dbstore.git Changed the partition by just to use the fk on the dimension tables. This should be sufficient as each tuple (hostname_id, plugin_id, type_id) is unique --- diff --git a/sql/metrics.sql b/sql/metrics.sql index c7e24ea..2a06268 100644 --- a/sql/metrics.sql +++ b/sql/metrics.sql @@ -127,17 +127,14 @@ $$ LANGUAGE plpgsql; -- SELECT timestamp, -- ((m.measure - lag(m.measure) -- over(partition by m.hostname_id, --- p.plugin, --- p.plugin_instance, --- t.type, --- t.type_instance --- order by timestamp, m.hostname_id, p.plugin, p.plugin_instance, t.type, t.type_instance))) AS metric, +-- p.plugin_id, +-- t.type_id, +-- order by timestamp, m.hostname_id, p.plugin_id, t.type_id))) AS metric, -- m.hostname_id, -- m.plugin_id, -- m.type_id -- FROM metrics m, plugin_dimension p, type_dimension t -- where m.type_id = t.id --- and m.plugin_id = p.id -- and t.ds_type = 'COUNTER' -- UNION -- select timestamp, m.measure as metric,