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 orderpull/2769/head
parent
0a6aeec21b
commit
ddda3026b6
@ -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…
Reference in new issue