with blocks as (
select
'Arbitrum' as network,
a.block_timestamp,
a.tx_count,
DATEDIFF('millisecond', a.block_timestamp, b.block_timestamp) as duration
from
arbitrum.core.fact_blocks a
join arbitrum.core.fact_blocks b on a.hash = b.parent_hash
where
a.tx_count > 0
)
select
network,
duration,
tx_count,
count(*) as cnt
from
blocks
where
tx_count < 60
group by
network, duration, tx_count
order by
network, duration, tx_count