From 82aef52f21bb428f92f5f30ea03b6213d941d25e Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 8 Feb 2024 02:04:12 +0100 Subject: [PATCH] Layout: Remove `queries` folder. It never learned flying. --- queries/timebuckets-minmax-values/README.rst | 13 ---------- queries/timebuckets-minmax-values/query.sql | 27 -------------------- 2 files changed, 40 deletions(-) delete mode 100644 queries/timebuckets-minmax-values/README.rst delete mode 100644 queries/timebuckets-minmax-values/query.sql diff --git a/queries/timebuckets-minmax-values/README.rst b/queries/timebuckets-minmax-values/README.rst deleted file mode 100644 index 1eaba36a..00000000 --- a/queries/timebuckets-minmax-values/README.rst +++ /dev/null @@ -1,13 +0,0 @@ -***** -About -***** - -How to query for minimum/maximum values in x minute time-buckets, -while keeping the original time stamps of those values. - - -******* -Details -******* - -Todo. diff --git a/queries/timebuckets-minmax-values/query.sql b/queries/timebuckets-minmax-values/query.sql deleted file mode 100644 index 08c89c11..00000000 --- a/queries/timebuckets-minmax-values/query.sql +++ /dev/null @@ -1,27 +0,0 @@ -SELECT uid,nameid,name,unit,value,timestamp -FROM - (SELECT - uid, - nameid, - name, - unit, - timestamp, - value, - FIRST_VALUE(value) OVER (w) AS "max", - -- FIRST_VALUE(timestamp) OVER (w) AS "max_ts", - LAST_VALUE(value) OVER (w) AS "min", - -- LAST_VALUE(timestamp) OVER (w) AS "min_ts" - FROM telemetry_01 - WHERE "nameid" in - ('43CAB42B447E4578DEEDF43B211A3FFE174445529A21948318B05ECD9E2C76E6', - '01DB60764B125AF8102F10E21E45470BC7C2D0A095F43C24FC83B55BCA726726', - '507744F768594E94A2D65BE1F7FC69ABA27317D942224626EB56E8212F7655E5', - '32B4D18C6FE2250049F27737E1EC2E4B56623491592D03FEF55FCC2B8E4ADBB5') - AND "timestamp" >= '2021-01-22T02:54:44.6100000Z' - AND "timestamp" < '2021-01-22T03:59:19.2480000Z' - WINDOW "w" AS (PARTITION BY uid, nameid, name, unit, - FLOOR((EXTRACT(EPOCH FROM timestamp)) / 300) - ORDER BY "value" DESC - RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - ORDER BY 1,2,3,4,5) s -WHERE value = max OR value = min