How do exchanges provide wallets unique wallets to users but also keep transaction fees low? So I understand that exchanges don't have to perform updates on the blockchain. However I'm not sure how they figure out the following solution without having to pay blockchain fees? I guess they do
i.e.

An exchange gives 3 users, Bill, Jane &amp; Sally a BTC address.
Bill &amp; Jane both send in 0.001 BTC to that address from a different exchange/wallet.
Now Bill &amp; Jane both send 0.0005 BTC to Sally on the same exchange. Same exchange so this doesn't have to be on the chain.
So now Bill &amp; Jane both have 0.0005 BTC and Sally has 0.001 BTC according to the exchange. However both Bill &amp; Jane's actual wallet address still has 0.001.
Sally now withdraws her 0.001 BTC

The exchange now needs to perform two blockchain updates to fulfill this withdraw which means two transaction fees on the blockchain for the exchange.
Does anybody know how exchanges do this?
Users don't have addresses at exchanges. When you deposit to the exchange you're depositing to the exchanges wallet, with a unique address just enabling them to account for who to credit the internal balance to. Withdraws only require one on chain transaction, just debiting the amount from the database and then sending that value to the address requested.