MostlyData_Solana CU - Forbidden Region
Updated 2025-02-03
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
›
⌄
⌄
/*
https://solana.com/it/developers/guides/advanced/how-to-optimize-compute
Solana has a max of 48000000 units per block
*/
with date_filter as (
select
case
when '{{n_days}}' != 0 then current_date() - interval '{{n_days}} days'
else cast('{{start_date}}' as timestamp)
end as start_date,
case
when '{{n_days}}' != 0 then current_date()
else cast('{{end_date}}' as timestamp)
end as end_date
)
,compute_unit_data_raw as(
select
date_trunc('hour', block_timestamp) as dt,
block_id,
sum(units_consumed) as cu,
sum(units_consumed) / 48000000 * 100 as share_of_max_cu
from solana.core.fact_transactions ft
join date_filter df
on ft.block_timestamp between df.start_date and df.end_date
group by 1,2
)
,validator_data as(
select
distinct node_pubkey,
vote_pubkey,
QueryRunArchived: QueryRun has been archived