Fetch share counts from pre-aggregation table
@@ -119,7 +119,7 @@ namespace MiningCore.Persistence.Postgres.Repositories
{
logger.LogInvoke(new[] { poolId, miner });
- var query = "SELECT (SELECT SUM(difficulty) FROM shares WHERE poolid = @poolId AND miner = @miner) AS pendingshares, " +
+ var query = "SELECT (SELECT SUM(sharesaccumulated) FROM minerstats_pre_agg WHERE poolid = @poolId AND miner = @miner) AS pendingshares, " +
"(SELECT amount FROM balances WHERE poolid = @poolId AND address = @miner) AS pendingbalance, " +
"(SELECT SUM(amount) FROM payments WHERE poolid = @poolId and address = @miner) as totalpaid";
