X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D83D9555BA for ; Fri, 4 Mar 2005 16:36:27 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 15768-07 for ; Fri, 4 Mar 2005 16:36:26 +0000 (GMT) Received: from fep3.cogeco.net (smtp.cogeco.net [216.221.81.25]) by svr1.postgresql.org (Postfix) with ESMTP id 7F8B755554 for ; Fri, 4 Mar 2005 16:36:25 +0000 (GMT) Received: from windsortransportationclub.com (d57-59-156.home.cgocable.net [24.57.59.156]) by fep3.cogeco.net (Postfix) with SMTP id 90E653ECD for ; Fri, 4 Mar 2005 11:36:24 -0500 (EST) Received: (qmail 13556 invoked from network); 4 Mar 2005 17:07:33 -0000 Received: from unknown (HELO javadude) (24.57.59.156) by 0 with SMTP; 4 Mar 2005 17:07:33 -0000 Message-ID: <000e01c520d8$4f899a90$780ba8c0@javadude> From: "Ken" To: "Richard Huxton" , References: <001001c51ef4$3849eeb0$6a01a8c0@KEN> <200503022152.13211.josh@agliodbs.com> <004601c51fbe$828bbb50$6a01a8c0@KEN> <200503030935.14537.josh@agliodbs.com> <001d01c5204a$b440edf0$6a01a8c0@KEN> <4227AA36.2080700@arbash-meinel.com> <000e01c5207a$1f668ac0$6a01a8c0@KEN> <42288529.7000803@archonet.com> Subject: Re: Help with tuning this query (with explain analyze finally) Date: Fri, 4 Mar 2005 11:36:26 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/74 X-Sequence-Number: 10779 Richard, What do you mean by summary table? Basically a cache of the query into a table with replicated column names of all the joins? I'd probably have to whipe out the table every minute and re-insert the data for each carrier in the system. I'm not sure how expensive this operation would be, but I'm guessing it would be fairly heavy-weight. And maintaince would be a lot harder because of the duplicated columns, making refactorings on the database more error-prone. Am I understanding your suggestion correctly? Please correct me if I am. > Can you turn the problem around? Calculate what you want for all users > (once every 60 seconds) and stuff those results into a summary table. Then > let the users query the summary table as often as they like (with the > understanding that the figures aren't going to update any faster than once > a minute)