Rewrite query for token transfers on address to eliminate "or" (#9576)
* Rewrite query for token transfers on address to eliminate "or" * Add token_transfers [:to_address_hash, :block_number] index * Review processing * Review processing #2 * Update apps/explorer/lib/explorer/chain/token_transfer.ex Co-authored-by: Kirill Fedoseev <kirill@blockscout.com> --------- Co-authored-by: Kirill Fedoseev <kirill@blockscout.com>pull/9640/head
parent
5505206714
commit
0eb7501211
@ -0,0 +1,9 @@ |
||||
defmodule Explorer.Repo.Migrations.TokenTransfersAddFromAddressHashBlockNumberIndex do |
||||
use Ecto.Migration |
||||
@disable_ddl_transaction true |
||||
@disable_migration_lock true |
||||
|
||||
def change do |
||||
create_if_not_exists(index(:token_transfers, [:from_address_hash, :block_number], concurrently: true)) |
||||
end |
||||
end |
@ -0,0 +1,9 @@ |
||||
defmodule Explorer.Repo.Migrations.TokenTransfersAddToAddressHashBlockNumberIndex do |
||||
use Ecto.Migration |
||||
@disable_ddl_transaction true |
||||
@disable_migration_lock true |
||||
|
||||
def change do |
||||
create_if_not_exists(index(:token_transfers, [:to_address_hash, :block_number], concurrently: true)) |
||||
end |
||||
end |
Loading…
Reference in new issue