perf: Improve performance of token page transfers tab (#9809)
* Improve performance of token page transfers tab * mix format * Separate index creation and deletion to defferent migrations * Rename migrationpull/9904/head
parent
01fe4e5537
commit
0c5278c8be
@ -0,0 +1,11 @@ |
||||
defmodule Explorer.Repo.Migrations.EnhanceIndexForTokenTransfersList do |
||||
use Ecto.Migration |
||||
@disable_ddl_transaction true |
||||
@disable_migration_lock true |
||||
|
||||
def change do |
||||
create_if_not_exists( |
||||
index(:token_transfers, ["token_contract_address_hash, block_number DESC, log_index DESC"], concurrently: true) |
||||
) |
||||
end |
||||
end |
@ -0,0 +1,9 @@ |
||||
defmodule Explorer.Repo.Migrations.DropOutdatedIndexForTokenTransfersList do |
||||
use Ecto.Migration |
||||
@disable_ddl_transaction true |
||||
@disable_migration_lock true |
||||
|
||||
def change do |
||||
drop_if_exists(index(:token_transfers, [:token_contract_address_hash, :block_number], concurrently: true)) |
||||
end |
||||
end |
Loading…
Reference in new issue