Coiny refresh
#3
Still bad. An even better solution would be to store each transaction as two records - for the src account and for the dst account. This way we could later on compress the old transactions - replace the oldest N hundred transactions for an account with a single transaction, "balance transfer" and thus the number of transactions that comprise a single account's balance would be kept in reasonable numbers. It would even make counting the balance easier, as it would be a single query, as opposed to the previous system that needs two queries (sum(amount) for incoming minus sum(amount) for outgoing). Each money transfer would effectively become two transaction records - one for the src account, the other for the dst account; the amount in one being negative of the amount in the other.

Why do I feel so dumb for not coming up with this natural system earlier?
Reply
Thanks given by:


Messages In This Thread
Coiny refresh - by xoft - 10-04-2014, 07:12 PM
RE: Coiny refresh - by xoft - 10-08-2014, 03:30 AM
RE: Coiny refresh - by xoft - 10-08-2014, 05:00 AM
RE: Coiny refresh - by tigerw - 10-08-2014, 06:59 AM
RE: Coiny refresh - by xoft - 10-08-2014, 03:16 PM
RE: Coiny refresh - by tigerw - 10-09-2014, 05:12 AM



Users browsing this thread: 1 Guest(s)