From e13c2f7ca76664f818b98062d0d90033c53484ee Mon Sep 17 00:00:00 2001 From: Bob Cotton Date: Fri, 1 May 2009 12:28:52 -0600 Subject: [PATCH] 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 --- sql/metrics.sql | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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, -- 2.11.0