That does make sense, the only problem is we're fetching far more than one row per register, and using a dependent sub-query means it gets run for every ROW returned (even if the result is the same). I'm not sure this would be any more performant (plus I hate sub-queries with a passion) but its worth giving a shot.
If it helps here is the basics of the query we're looping over, and then we only run the query for beginning balance the first time we see a register:
SELECT
register_id,
name,
transaction_type,
SUM(amount) as amount
FROM
register_transactions
JOIN
register USING (register_id)
GROUP BY
transaction_type,
register_id
ORDER BY created
Unfortunately I can't use aggregate functions like MIN?MAX because we can't guarantee that the beginning balance is the minimum balance after, for example if the first transaction for the day is a refund as opposed to a sale.