维持客户帐户余额的最佳方式 [英] Best way to maintain a customer's account balance

查看:150
本文介绍了维持客户帐户余额的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在数据库中存储客户帐户余额或使用视图和查询来生成信息更好。

Is it better to have a field in the database that stores the customers account balance or use views and queries to generate the information.

推荐答案

对于性能,我会说两个。保留所有交易的日志(在单独的表中),但在客户记录中保留一个字段,用于存储当您添加更多交易时刷新的当前余额。

For performance, I'd say both. Keep a log of all the transactions (in a separate table) but maintain a field in the customer record that stores the current balance that gets refreshed when you add more transactions.

这篇关于维持客户帐户余额的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆