MufasaMinimum, maximum and average block time per day
Updated 2023-01-08Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
›
⌄
with final_data as (
select
date_trunc('day', date) as first_date,
avg(total_count/ tps_average) as average_count,
max(total_count/tps_average) as maximum_count,
min(total_count/tps_average) as minimum_count
from (select
data_one.date,
avg(data_one.total_count/60) as tps_average
from (select
to_date(block_timestamp) as date,
date_trunc('min', block_timestamp) as min_date,
count(*) as total_count
from near.core.fact_transactions
group by date, min_date ) data_one
group by date) data_one left outer join (select
block_id,
min(to_date(block_timestamp)) as second_date,
count(*) as total_count
from near.core.fact_transactions
group by block_id ) data_two on
date = second_date
where first_date > current_date - 60
group by first_date
order by first_date
)
select * from final_data
Run a query to Download Data