From e4d76fc3ea7827c04be34763a6e72f6a0bfd4cf4 Mon Sep 17 00:00:00 2001 From: Jonathan Halterman Date: Tue, 29 Jul 2014 16:07:16 -0700 Subject: [PATCH] Add created_at timestamp to vertica monmetrics.definitions table --- files/default/vertica/mon_metrics_schema.sql | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/files/default/vertica/mon_metrics_schema.sql b/files/default/vertica/mon_metrics_schema.sql index 37c2cf0..0032405 100644 --- a/files/default/vertica/mon_metrics_schema.sql +++ b/files/default/vertica/mon_metrics_schema.sql @@ -15,9 +15,10 @@ CREATE TABLE MonMetrics.Definitions( name VARCHAR(255) NOT NULL, tenant_id VARCHAR(255) NOT NULL, region VARCHAR(255) NOT NULL, + created_at TIMESTAMP NOT NULL, PRIMARY KEY(id), CONSTRAINT MetricsDefinitionsConstraint UNIQUE(name, tenant_id, region) -); +) PARTITION BY EXTRACT('year' FROM created_at)*10000 + EXTRACT('month' FROM created_at)*100 + EXTRACT('day' FROM created_at); CREATE TABLE MonMetrics.Dimensions ( dimension_set_id BINARY(20) NOT NULL, @@ -59,13 +60,15 @@ CREATE PROJECTION Definitions_DBD_2_rep_MonMetrics /*+createtype(D)*/ id ENCODING RLE, name ENCODING AUTO, tenant_id ENCODING RLE, - region ENCODING RLE + region ENCODING RLE, + created_at ENCODING DELTAVAL ) AS SELECT id, name, tenant_id, - region + region, + created_at FROM MonMetrics.Definitions ORDER BY id, tenant_id,