Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id BAD062E004B for ; Tue, 6 May 2008 14:22:18 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 96531-03 for ; Tue, 6 May 2008 14:22:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.emproshunts.com (mail.emproshunts.com [66.64.191.19]) by developer.postgresql.org (Postfix) with ESMTP id DF0832E0042 for ; Tue, 6 May 2008 14:22:14 -0300 (ADT) Received: from [192.168.1.49] by mail.emproshunts.com (GMS 15.00.3626/KX5895.00.ca7cb0e7) with ESMTP id ttamhaaa for pgsql-performance@postgresql.org; Tue, 6 May 2008 13:22:13 -0400 Message-ID: <482093C3.1050604@emproshunts.com> Date: Tue, 06 May 2008 12:22:11 -0500 From: Justin User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Shaun Thomas , pgsql-performance@postgresql.org Subject: Re: need to speed up query References: <481FBC0D.7010509@emproshunts.com> <1210092209.14833.32.camel@berners-lee> In-Reply-To: <1210092209.14833.32.camel@berners-lee> Content-Type: multipart/alternative; boundary="------------090401050408080902050600" X-Originating-IP: [192.168.1.49] X-DNSBL: 0 X-AntiSpam: Checked for restricted content by Gordano's AntiSpam Software X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/93 X-Sequence-Number: 30061 This is a multi-part message in MIME format. --------------090401050408080902050600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit it worked it had couple missing parts but it worked and ran in 3.3 seconds. *Thanks for this * i need to review the result and balance it to my results as the Accountant already went through and balanced some accounts by hand to verify my results <> You might want to consider a denormalized summary table that contains this information (and maybe more) maintained by a trigger or regularly invoked stored-procedure and then you can select from *that* with much less agony. <> I just dumped the summary table because it kept getting out of balance all the time and was missing accounts that did not have transaction in them for given period. Again i did not lay out the table nor the old code which was terrible and did not work correctly. I tried several times to fix the summary table but to many things allowed it to get out of sync. Keeping the Ending and Beginning Balance correct was to much trouble and i needed to get numbers we can trust to the accountant. The developers of the code got credits and debits backwards so instead of fixing the code they just added code to flip the values on the front end. Its really annoying. At this point if i could go back 7 months ago i would not purchased this software if i had known what i know now. I've had to make all kinds of changes i never intended to make in order to get the stuff to balance and agree. I've spent the last 3 months in code review fixing things that allow accounts to get out of balance and stop stupid things from happening, like posting GL Transactions into non-existing accounting periods. the list of things i have to fix is getting dam long. --------------090401050408080902050600 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit it worked it had couple missing parts but it worked and ran in 3.3 seconds.  Thanks for this
i need to review the result and balance it to my results as the Accountant already went through and balanced some accounts by hand to verify my results

<<begin quote>>
 You might want to consider a
denormalized summary table that contains this information (and maybe
more) maintained by a trigger or regularly invoked stored-procedure and
then you can select from *that* with much less agony.
<<end quote>>

I just dumped the summary table because it kept getting out of balance all the time and was missing accounts that did not have transaction in them for given period.  Again i did not lay out the table nor the old code which was terrible and did not work  correctly.   I tried several times to fix the summary table  but to many  things allowed it to get out of sync.  Keeping the Ending and Beginning Balance correct was to much trouble and i needed to get numbers we can trust to the accountant. 

The developers of the code got credits and debits backwards so instead of fixing the code they just added code to flip the values on the front end.  Its really annoying.  At this point if i could go back 7 months ago i would not purchased this software if i had known what i know now.

I've had to make all kinds of changes i never intended to make in order to get the stuff to balance and agree. I've spent the last 3 months in code review fixing things that allow accounts to get out of balance and stop stupid things from happening, like posting GL Transactions into non-existing accounting periods.  the list of things i have to fix is getting dam long.


--------------090401050408080902050600--