mlhUntitled Query
    Updated 2022-07-27
    select avg(diff) as avg_block_time, max(diff) as max_block_time, min(diff) as min_block_time, avg(tx_count) as avg_block_tx, 'Polygon' as blockchain
    from (
    select block_timestamp, lead(block_timestamp) over(order by block_number) as next_block_time, datediff('s',block_timestamp,next_block_time) as diff, tx_count
    from polygon.core.fact_blocks
    where block_timestamp::date >= '2022-01-01'
    )

    union all

    select avg(diff) as avg_block_time, max(diff) as max_block_time, min(diff) as min_block_time, avg(tx_count) as avg_block_tx, 'Flow' as blockchain
    from (
    select block_timestamp, lead(block_timestamp) over(order by block_height) as next_block_time, datediff('s',block_timestamp,next_block_time) as diff, tx_count
    from flow.core.fact_blocks
    where block_timestamp::date >= '2022-01-01'
    )

    union all

    select avg(diff) as avg_block_time, max(diff) as max_block_time, min(diff) as min_block_time, avg(tx_count) as avg_block_tx, 'Solana' as blockchain
    from (
    select block_timestamp, lead(block_timestamp) over(order by block_id) as next_block_time, datediff('s',block_timestamp,next_block_time) as diff, tx_count
    from solana.core.fact_blocks
    where block_timestamp::date >= '2022-01-01'
    )

    union all

    select avg(diff) as avg_block_time, max(diff) as max_block_time, min(diff) as min_block_time, avg(tx_count) as avg_block_tx, 'Optimism' as blockchain
    from (
    select block_timestamp, lead(block_timestamp) over(order by block_number) as next_block_time, datediff('s',block_timestamp,next_block_time) as diff, tx_count
    from optimism.core.fact_blocks
    where block_timestamp::date >= '2022-01-01'
    )

    union all

    Run a query to Download Data