flyingfishToo slow of a query - bSOL mint events
Updated 2023-09-02
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
mint_actions AS (
/* This part takes anywhere from 20 to 40s */
SELECT
block_timestamp
, index
, mint
, mint_amount
, tx_id
FROM solana.silver.mint_actions
WHERE succeeded
AND event_type = 'mintTo'
AND mint = 'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1'
AND block_timestamp > '2023-08-01' -- The start of bSOL is 2022-05-02
),
mint_events AS (
/* This part takes the query time to anywhere from 40 to 60s */
SELECT
tx_id
, program_id
, signers[0] AS signer
, index
FROM solana.core.fact_events
WHERE tx_id IN (SELECT tx_id FROM mint_actions)
AND block_timestamp > '2023-08-01'
AND inner_instruction IS NOT NULL
),
combined AS (
/* This part will likely timeout with dates prior to August 2023*/
SELECT
mint_actions.*
, mint_events.index AS cte_index
, mint_events.program_id
, mint_events.signer
FROM mint_actions
JOIN mint_events
Run a query to Download Data