Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
add additional clauses for efficiency
Browse files Browse the repository at this point in the history
Signed-off-by: Pranay Valson <[email protected]>
  • Loading branch information
noslav committed Mar 28, 2023
1 parent 59522b4 commit 47f8d80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sql/proof_chain_mbase_specimen.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ session_started_events AS (
'\x49caa59dfff8e73f72d249149e72487a67c49cf76549aed997c63963b436c3c2'::bytea
]
AND trx.successful = TRUE
AND session_started.block_id >= '1910104892088990000'::bigint
ORDER BY session_started.block_id ASC, session_started.log_offset ASC
),
specimen_reward_awarded_events AS (
Expand All @@ -30,6 +31,7 @@ specimen_reward_awarded_events AS (
fin.sender = '\x19492a5019B30471aA8fa2c6D9d39c99b5Cda20C'::bytea
AND fin.topics @> ARRAY['\xf05ac779af1ec75a7b2fbe9415b33a67c00294a121786f7ce2eb3f92e4a6424a'::bytea]
AND trx_1.successful = TRUE
AND fin.block_id >= '1910104892088990000'::bigint
ORDER BY fin.block_id ASC, fin.log_offset ASC
),
specimen_quorum_not_reached_events AS (
Expand All @@ -44,6 +46,7 @@ specimen_quorum_not_reached_events AS (
fin.sender = '\x19492a5019B30471aA8fa2c6D9d39c99b5Cda20C'::bytea
AND fin.topics @> ARRAY['\x8340aa7a5b37153230f8b64fa66f25c843e5002c60e63a25db6a9195005ccabd'::bytea]
AND trx_1.successful = TRUE
AND fin.block_id >= '1910104892088990000'::bigint
ORDER BY fin.block_id ASC, fin.log_offset ASC
),
all_finalization_events AS (
Expand All @@ -64,5 +67,6 @@ LEFT JOIN all_finalization_events afe ON (
sse.origin_chain_id = afe.origin_chain_id
AND sse.origin_chain_block_height = afe.origin_chain_block_height
)
WHERE sse.origin_chain_block_height > 16568764::numeric
ORDER BY sse.observer_chain_block_id ASC, sse.observer_chain_tx_offset ASC
;

0 comments on commit 47f8d80

Please sign in to comment.