Salehp-v-p-compare all
Updated 2022-07-23
999
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 lst_all_polygon as (
select
BLOCK_NUMBER
,lag(BLOCK_TIMESTAMP,1) over( order by BLOCK_TIMESTAMP) as date_lag
,datediff(second,date_lag,BLOCK_TIMESTAMP) as date_diff_block
from polygon.core.fact_blocks
)
,dist_poly as (
select
case
when DATE_DIFF_BLOCK >=0 and DATE_DIFF_BLOCK<=3 then '0 Sec To 3 Sec'
when DATE_DIFF_BLOCK >3 and DATE_DIFF_BLOCK<=5 then '4 Sec To 5 Sec'
when DATE_DIFF_BLOCK >5 and DATE_DIFF_BLOCK<=10 then '6 Sec To 10 Sec'
when DATE_DIFF_BLOCK >10 and DATE_DIFF_BLOCK<=30 then '11 Sec To 30 Sec'
when DATE_DIFF_BLOCK >30 then 'More than 31 seconds'
end as Distribution
,count(DATE_DIFF_BLOCK) as block_counts
from lst_all_polygon
where DATE_DIFF_BLOCK>0
group by 1
order by 1
)
, lst_all_sol as (
select
BLOCK_ID
,lag(BLOCK_TIMESTAMP,1) over( order by BLOCK_TIMESTAMP) as date_lag
,datediff(second,date_lag,BLOCK_TIMESTAMP) as date_diff_block
from solana.core.fact_blocks
)
,dist_sol as (
select
case
when DATE_DIFF_BLOCK >=0 and DATE_DIFF_BLOCK<=3 then '0 Sec To 3 Sec'
when DATE_DIFF_BLOCK >3 and DATE_DIFF_BLOCK<=5 then '4 Sec To 5 Sec'
when DATE_DIFF_BLOCK >5 and DATE_DIFF_BLOCK<=10 then '6 Sec To 10 Sec'
when DATE_DIFF_BLOCK >10 and DATE_DIFF_BLOCK<=30 then '11 Sec To 30 Sec'
Run a query to Download Data