optimize token token transfers query

the longes part of the query is ordering.
Removing order clause from the query makes a
query much faster. It's because by default indexes
are ordered in ASC order
pull/2769/head
Ayrat Badykov 5 years ago
parent 0a6aeec21b
commit ddda3026b6
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 12
      apps/explorer/priv/repo/migrations/20191009121635_add_token_transfer_sorting_indexes.exs

@ -0,0 +1,12 @@
defmodule Explorer.Repo.Migrations.AddTokenTransferSortingIndexes do
use Ecto.Migration
def change do
create(
index(
:token_transfers,
["block_number DESC", "log_index DESC"]
)
)
end
end
Loading…
Cancel
Save