SELECT "graphs_volume24hoursmetric"."time", "graphs_volume24hoursmetric"."value"
FROM "graphs_volume24hoursmetric"
WHERE ("graphs_volume24hoursmetric"."pool_id" = c6e6b7bd-1f0e-4766-89ed-56bc592742ed AND "graphs_volume24hoursmetric"."time" BETWEEN 2023-03-02 10:58:03.333117+00:00 AND 2023-03-05 10:58:03.333130+00:00)
This query outputs all the points that were created after 3 days.
Then I've used time_bucket_gapfill according to the documentation in the README.
Wrote:
SELECT "graphs_volume24hoursmetric"."time", AVG("graphs_volume24hoursmetric"."value") AS "value"
FROM "graphs_volume24hoursmetric" WHERE ("graphs_volume24hoursmetric"."pool_id" = c6e6b7bd-1f0e-4766-89ed-56bc592742ed AND "graphs_volume24hoursmetric"."time" BETWEEN 2023-03-02 11:07:24.915758+00:00 AND 2023-03-05 11:07:24.915784+00:00)
GROUP BY time_bucket_gapfill(INTERVAL 1 day, "graphs_volume24hoursmetric"."time", 2023-03-02 11:07:24.915758+00:00, 2023-03-05 11:07:24.915784+00:00), "graphs_volume24hoursmetric"."time"
Hoping to get 3 points, I get some bullshit out of 40 points.
According to the official documentation, you need to use the function after the 'SELECT" keyword, and not after "GROUP BY". In my case, aggregation should occur in the interval of 1 day, not 40.
Time buckets are usually used together with GROUP BY to aggregate data. But you can also run time_bucket on a single time value.
According to the official documentation, the functions should be after the keyword "SELECT".
I wrote:
And I've got this SQL:
This query outputs all the points that were created after 3 days.
Then I've used
time_bucket_gapfill
according to the documentation in the README. Wrote:Got:
Hoping to get 3 points, I get some bullshit out of 40 points. According to the official documentation, you need to use the function after the 'SELECT" keyword, and not after "GROUP BY". In my case, aggregation should occur in the interval of 1 day, not 40.