MostlyData_PDF gas usage with block filter
Updated 2024-12-04Copy 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
28
29
30
31
32
33
34
35
36
›
⌄
⌄
with block_info as(
select
block_number
,tx_count
,gas_used
,block_header_json['baseFeePerGas'] as baseFeePerGas
from ethereum.core.fact_blocks
where
block_timestamp >= current_date() - interval '{{n_days}} days'
--and gas_used < 16000000
--and gas_used > 15000000
and tx_count > 196
)
,filtered_txs as(
select
tx.gas_used,
tx.position,
case
when tx.position between 0 and 10 then 'T_0_10'
when tx.position between 11 and 50 then 'T_11_50'
else 'T_50_plus'
end as position_group
from ethereum.core.fact_transactions tx
inner join block_info b on tx.block_number = b.block_number
/*
where
tx.gas_used > 0
and tx.gas_used < 200000
*/
)
QueryRunArchived: QueryRun has been archived