-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support efficient query for related account with method filter #897
base: main
Are you sure you want to change the base?
Conversation
35a0bc7
to
61c160b
Compare
61c160b
to
d1e1d73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait where does this go relative to the related accounts change?
end_block INT; | ||
max_block INT; | ||
affected_rows INT; | ||
BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of this stuff seems to be in the wrong commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
The related accounts change (#809) was only for the events tables. Transactions tables already had related accounts split out in a separate table, so no changes were needed in #809. This PR only deals with transaction tables. We denomralize some fields so that we can have more efficient indexes for the combination of related accounts + method filters. These filters are not needed for the events tables at this time, so no changes there. |
ce7f74f
to
8151721
Compare
8151721
to
f1b94db
Compare
CREATE INDEX ix_runtime_related_transactions_address_method_round ON chain.runtime_related_transactions (runtime, account_address, method, tx_round, tx_index); | ||
CREATE INDEX ix_runtime_related_transactions_address_native_transfer_round ON chain.runtime_related_transactions (runtime, account_address, likely_native_transfer, tx_round, tx_index); | ||
-- This combination is needed, since explorer needs to obtain evm.Call's which are not native transfers. | ||
CREATE INDEX ix_runtime_related_transactions_address_method_native_transfer_round ON chain.runtime_related_transactions (runtime, account_address, method, likely_native_transfer, tx_round, tx_index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want tx_round DESC
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be equivalent either way, with the preceding fields only filtered by equality
Fixes: #896
Note: The migrations will likely take multiple hours Before this is released and deployed, it would be good to have "Nexus Blue " ready so that we can switch Nexus backend explorer uses during the update.