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 823F05E46C5 for ; Fri, 6 Aug 2004 14:07:37 -0300 (ADT) 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 35170-07 for ; Fri, 6 Aug 2004 17:07:27 +0000 (GMT) Received: from mail.academyoflearning.ca (s64-180-138-192.bc.hsia.telus.net [64.180.138.192]) by svr1.postgresql.org (Postfix) with ESMTP id B62B25E46C0 for ; Fri, 6 Aug 2004 14:07:22 -0300 (ADT) Received: from [192.168.1.10] (d216-232-247-236.bchsia.telus.net [216.232.247.236]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.academyoflearning.ca (Postfix) with ESMTP id 6899E34DBC; Fri, 6 Aug 2004 10:06:53 -0700 (PDT) Subject: Re: Performance Bottleneck From: Mike Benoit To: Gaetano Mendola Cc: pgsql-performance@postgresql.org In-Reply-To: <4110FFF6.1030001@bigfoot.com> References: <410FDC53.5080509@bigfoot.com> <4110FFF6.1030001@bigfoot.com> Content-Type: text/plain Date: Fri, 06 Aug 2004 10:06:51 -0700 Message-Id: <1091812011.7149.25.camel@ipso.snappymail.ca> Mime-Version: 1.0 X-Mailer: Evolution 1.5.91-2mdk Content-Transfer-Encoding: 7bit X-snappymail-MailScanner-Information: Please contact the ISP for more information X-snappymail-MailScanner: Found to be clean X-snappymail-MailScanner-SpamCheck: not spam, SpamAssassin (score=1.911, required 5, AWL -0.79, RCVD_IN_DYNABLOCK 2.60, RCVD_IN_SORBS 0.10) X-snappymail-MailScanner-SpamScore: s X-MailScanner-From: ipso@snappymail.ca X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200408/80 X-Sequence-Number: 7716 On Wed, 2004-08-04 at 17:25 +0200, Gaetano Mendola wrote: > > The queries themselves are simple, normally drawing information from one > > table with few conditions or in the most complex cases using joins on > > two table or sub queries. These behave very well and always have, the > > problem is that these queries take place in rather large amounts due to > > the dumb nature of the scripts themselves. > > Show us the explain analyze on that queries, how many rows the tables are > containing, the table schema could be also usefull. > If the queries themselves are optimized as much as they can be, and as you say, its just the sheer amount of similar queries hitting the database, you could try using prepared queries for ones that are most often executed to eliminate some of the overhead. I've had relatively good success with this in the past, and it doesn't take very much code modification. -- Mike Benoit