Skip to content

Commit

Permalink
Merge pull request #1 from galacticcouncil/filter-periods
Browse files Browse the repository at this point in the history
adjust to only get last day/week
  • Loading branch information
vgantchev authored Jul 18, 2023
2 parents 3e91a67 + 5e8755e commit c7871f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion queries/hydradx-ui/v1/statsPeriodic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ with src_data AS (
ELSE
1=1
END
AND timestamp > (SELECT MAX(timestamp) FROM stats_historical) - interval :sqlQuerySecondsLabel * 60
),
series AS (
SELECT
generate_series(
to_timestamp(floor((extract('epoch' from (SELECT MIN(timestamp) FROM src_data)) / :sqlQuerySeconds )) * :sqlQuerySeconds),
to_timestamp(ceiling((extract('epoch' from (SELECT MIN(timestamp) FROM src_data)) / :sqlQuerySeconds )) * :sqlQuerySeconds),
to_timestamp(floor((extract('epoch' from (SELECT MAX(timestamp) FROM src_data)) / :sqlQuerySeconds )) * :sqlQuerySeconds),
:sqlQuerySecondsLabel
) AS segment
Expand Down

0 comments on commit c7871f1

Please sign in to comment.