Fix performance of coin supply API endpoints

pull/3132/head
Victor Baranov 5 years ago
parent e48e438ae5
commit 1b3a80b448
  1. 1
      CHANGELOG.md
  2. 6
      apps/explorer/lib/explorer/chain.ex

@ -3,6 +3,7 @@
### Features ### Features
### Fixes ### Fixes
- [#3132](https://github.com/poanetwork/blockscout/pull/3132) - Fix performance of coin supply API endpoints
- [#3130](https://github.com/poanetwork/blockscout/pull/3130) - Take into account FIRST_BLOCK for block rewards fetching - [#3130](https://github.com/poanetwork/blockscout/pull/3130) - Take into account FIRST_BLOCK for block rewards fetching
- [#3128](https://github.com/poanetwork/blockscout/pull/3128) - Token instance metadata retriever refinement: add processing of token metadata if only image URL is passed to token URI - [#3128](https://github.com/poanetwork/blockscout/pull/3128) - Token instance metadata retriever refinement: add processing of token metadata if only image URL is passed to token URI
- [#3126](https://github.com/poanetwork/blockscout/pull/3126) - Fetch balance only for blocks which are greater or equal block with FIRST_BLOCK number - [#3126](https://github.com/poanetwork/blockscout/pull/3126) - Fetch balance only for blocks which are greater or equal block with FIRST_BLOCK number

@ -1517,7 +1517,8 @@ defmodule Explorer.Chain do
from( from(
a0 in Address, a0 in Address,
select: fragment("SUM(a0.fetched_coin_balance)"), select: fragment("SUM(a0.fetched_coin_balance)"),
where: a0.hash != ^burn_address_hash where: a0.hash != ^burn_address_hash,
where: a0.fetched_coin_balance > 0
) )
Repo.one!(query) || 0 Repo.one!(query) || 0
@ -1528,7 +1529,8 @@ defmodule Explorer.Chain do
query = query =
from( from(
a0 in Address, a0 in Address,
select: fragment("SUM(a0.fetched_coin_balance)") select: fragment("SUM(a0.fetched_coin_balance)"),
where: a0.fetched_coin_balance > 0
) )
Repo.one!(query) || 0 Repo.one!(query) || 0

Loading…
Cancel
Save