nitsBlock Performance
    Updated 2022-06-29
    with a as
    (
    SELECT block_timestamp as bt , block_number as bn from avalanche.core.fact_blocks),
    avalanche as
    (SELECT date(block_timestamp) as day, avg(td) as avg_time_taken,
    avg(avg_time_taken) over (order by day) as avg_time_taken_over_time , 'avalanche' as type
    from
    ( SELECT *
    , timestampdiff(sql_tsi_second,bt, block_timestamp) as td
    from a
    inner join avalanche.core.fact_blocks
    on block_number = bn +1 )
    where day>= '2022-05-01'
    GROUP by 1 ),
    e as
    (
    SELECT block_timestamp as bt , block_number as bn from ethereum.core.fact_blocks),
    eth as
    ( SELECT date(block_timestamp) as day, avg(td) as avg_time_taken,
    avg(avg_time_taken) over (order by day) as avg_time_taken_over_time , 'ethereum' as type
    from
    ( SELECT *
    , timestampdiff(sql_tsi_second,bt, block_timestamp) as td
    from e
    inner join ethereum.core.fact_blocks
    on block_number = bn +1 )
    where day>= '2022-05-01'
    GROUP by 1 ),
    p as
    (
    SELECT block_timestamp as bt , block_number as bn from polygon.core.fact_blocks),
    poly as
    ( SELECT date(block_timestamp) as day, avg(td) as avg_time_taken,
    avg(avg_time_taken) over (order by day) as avg_time_taken_over_time , 'polygon' as type
    from
    ( SELECT *
    Run a query to Download Data