Denormalize action_receipt_actions
table in order to improve common queries performance
#87
Closed
7 tasks done
Labels
enhancement
New feature or request
add columns to
action_receipt_actions
table and enable indices for them:predecessor_account_id
receiver_account_id
included_in_block_timestamp
The motivation is that JOINing with
receipts
table while doing filtering likereceiver_account_id = ? AND action_kind = ? AND args = ?
is slow. @vgrichina Could you provide a minimal useful query?Ideally, we want to have cross-table indices, but Postgres does not support that, though Postgres 12 and 13 claim to improve various aspects of index performance, so we may want to try to migrate our Postgres 11 database to Postgres 13 to see if that helps.
add index on
args->>'method_name'
forFUNCTION_CALL
actions (conditional index in Postgres)try to decode base64-encoded
args->>args_base64
to JSON (replace the original base64 field withargs->>args_json
if parsing succeeds), so ultimately we will either haveargs_base64
(e.g. rainbow bridge uses borsh instead of JSON args) orargs_json
(commonly used by NEAR smart contracts)args->>'args_json'->>'receiver_id'
andargs->>'args_json'->>'amount'
for FT and NFTThe text was updated successfully, but these errors were encountered: