-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c876fe4
commit 6dd7976
Showing
35 changed files
with
1,018 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE MATERIALIZED VIEW IF NOT EXISTS transfer_stats_by_hour | ||
WITH (timescaledb.continuous, timescaledb.materialized_only=false) AS | ||
select | ||
time_bucket('1 hour'::interval, time) AS ts, | ||
transfer.asset as asset, | ||
count(*) as transfers_count, | ||
sum(amount) as amount | ||
from transfer | ||
group by 1, 2 | ||
order by 1 desc; | ||
|
||
CALL add_view_refresh_job('transfer_stats_by_hour', INTERVAL '1 minute', INTERVAL '1 minute'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE MATERIALIZED VIEW IF NOT EXISTS transfer_stats_by_day | ||
WITH (timescaledb.continuous, timescaledb.materialized_only=false) AS | ||
select | ||
time_bucket('1 day'::interval, transfer_stats_by_hour.ts) AS ts, | ||
transfer_stats_by_hour.asset as asset, | ||
sum(transfers_count) as transfers_count, | ||
sum(amount) as amount | ||
from transfer_stats_by_hour | ||
group by 1, 2 | ||
order by 1 desc; | ||
|
||
CALL add_view_refresh_job('transfer_stats_by_day', INTERVAL '1 minute', INTERVAL '1 minute'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE MATERIALIZED VIEW IF NOT EXISTS transfer_stats_by_month | ||
WITH (timescaledb.continuous, timescaledb.materialized_only=false) AS | ||
select | ||
time_bucket('1 month'::interval, transfer_stats_by_day.ts) AS ts, | ||
transfer_stats_by_day.asset as asset, | ||
sum(transfers_count) as transfers_count, | ||
sum(amount) as amount | ||
from transfer_stats_by_day | ||
group by 1, 2 | ||
order by 1 desc; | ||
|
||
CALL add_view_refresh_job('transfer_stats_by_month', INTERVAL '1 minute', INTERVAL '1 hour'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.