Re: [GENERAL] 回复:[GENERAL] SP to calc shipments vs receipts - Mailing list pgsql-general

From Chris Travers
Subject Re: [GENERAL] 回复:[GENERAL] SP to calc shipments vs receipts
Date
Msg-id CAKt_ZftFFupNccgEVhfEL+j8_ACwpFfCQJRcKfm242KDw2N=qA@mail.gmail.com
Whole thread Raw
In response to =?gb18030?B?u9i4tKO6W0dFTkVSQUxdIFNQIHRvIGNhbGMgc2hp?= =?gb18030?B?cG1lbnRzIHZzIHJlY2VpcHRz?=  ("DDT" <410845160@qq.com>)
Responses =?gb18030?B?UmU6IFtHRU5FUkFMXSC72Li0o7pbR0VORVJBTF0g?= =?gb18030?B?U1AgdG8gY2FsYyBzaGlwbWVudHMgdnMgcmVjZWlw?= =?gb18030?B?dHM=?=  ("DDT" <410845160@qq.com>)
Re: 回复:[GENERAL]SP to calc shipments vs receipts  (Bret Stern <bret_stern@machinemanagement.com>)
List pgsql-general



On Wed, Sep 25, 2013 at 7:27 AM, DDT <410845160@qq.com> wrote:
By the way, you can try to save the current totals to another table.
update it through triggers when the inventory transactions changed.
it may lead to better performance on a large set of inventory transactions for query current totals

If you are going to do this, my recommendation is to store periodic summaries (i.e. for sum through date) and then aggregate rolling forward.  This vastly simplifies querying and data validation if you are only appending data. 
--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.

pgsql-general by date:

Previous
From: "DDT"
Date:
Subject: =?gb18030?B?u9i4tKO6W0dFTkVSQUxdIFNQIHRvIGNhbGMgc2hp?= =?gb18030?B?cG1lbnRzIHZzIHJlY2VpcHRz?=
Next
From: Bret Stern
Date:
Subject: Re: 回复:[GENERAL] SP tocalc shipments vs receipts