granadohoAverage Time Between Blocks
Updated 2022-01-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
WITH table1 as (
select
t1.block_id as block_id,
LAG(t1.timestamp, 1) OVER(ORDER BY block_id) AS start_time,
t1.timestamp as end_time,
TIMESTAMPDIFF(SECOND, LAG(t1.timestamp, 1) OVER(ORDER BY block_id), t1.timestamp) AS SECONDDIFFERENCE
from (
SELECT
block_id ,max(block_timestamp) AS timestamp
FROM algorand.block
GROUP BY block_id
ORDER BY timestamp ASC
) t1
)
SELECT
avg(table1.SECONDDIFFERENCE) as average_time_between_blocks
from table1
Run a query to Download Data