Add index to addresses table

Creates a partial index using the fetched_coin_balance and hash columns
pull/1140/head
Amanda Sposito 6 years ago
parent 40a9da3022
commit 8ad5a3103e
  1. 13
      apps/explorer/priv/repo/migrations/20181126203826_add_index_to_addresses.exs

@ -0,0 +1,13 @@
defmodule Explorer.Repo.Migrations.AddIndexToAddresses do
use Ecto.Migration
def up do
execute(
"CREATE INDEX addresses_fetched_coin_balance_hash_index ON addresses (fetched_coin_balance DESC, hash ASC) WHERE fetched_coin_balance > 0"
)
end
def down do
execute("DROP INDEX addresses_fetched_coin_balance_hash_index")
end
end
Loading…
Cancel
Save