From: Neil Tompkins Date: September 5 2010 6:32am Subject: Re: Best method to keep totals List-Archive: http://lists.mysql.com/mysql/222851 Message-Id: <4766FF85-D3B8-4769-BCC6-B29A29F5CCF1@googlemail.com> MIME-Version: 1.0 (iPod Mail 7E18) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Thanks for all the useful information. I'm going to ensure the relevant fields are indexed and our db is optimised. On 4 Sep 2010, at 16:10, Arthur Fuller wrote: > 100% agreed. > > Arthur > > The other exception is also where financial data is being stored. If > you >> have, say, a database containing sales order records, then as well as >> storing the individual values of each item in each order, you also >> need to >> store the total value of the order, the total price charged to the >> customer >> and the total paid by the customer. These three should, of course, >> be not >> only identical to each other but also to the sum of the individual >> items, so >> there is not only duplication but the potential for skew. But that, >> of >> course, is precisely *why* you store them, as any discrepancy >> indicates an >> error which needs to be investigated. >> >> Mark >>