-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: add index for efficient fetching of events emitted by a spec…
…ific contract
- Loading branch information
Showing
6 changed files
with
4,037 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
storage/migrations/07_runtime_events_evm_contracts_events.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
BEGIN; | ||
|
||
-- Index used for fetching all events of a specific type, of a specific contract (sorted by round). | ||
-- For example listing all ERC20 Transfers of a specific token. | ||
CREATE INDEX IF NOT EXISTS ix_runtime_events_evm_specific_contract_events ON chain.runtime_events (runtime, (body ->> 'address'), evm_log_signature, round) | ||
WHERE | ||
type = 'evm.log'; | ||
|
||
COMMIT; |
Oops, something went wrong.