Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0BD7F6503B4 for ; Thu, 7 Aug 2008 12:06:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 96894-04-3 for ; Thu, 7 Aug 2008 12:06:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by postgresql.org (Postfix) with ESMTP id C42C0650244 for ; Thu, 7 Aug 2008 12:05:32 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id 16so372820fgg.23 for ; Thu, 07 Aug 2008 08:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=RLvtbetg5LA/c1BWPU88uO4w8El6Vg35xxno2ElrsH0=; b=t7qGaXKu83XmlmrwqwTxwWoQrD3W/vFa87S+nk2DrkzjPCM6mQ7Sx2YfkyXdOLToVb haBo+vw+uAVm8Pyf6Zuyw1tKf8Nnrp+BnvtiMsc6wKRttAVphASLCSwOLlIHRJotI7vk qOclcQMY3CWAz8XIWdwpxES6ea1FnvrKPughc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=XAy05XJy6zvbtpdg/msJRYKju+vC++fuKXapce8h+JEmIWTZ3wx5/mRoHlEXLn7d7F MISlzMLc0C2aLa8zGAw5I+tyABbGCNxVU3OnLcWNEBDt8+yleH/mYNrZ2AbSvaYiUY7B ePYv/CN/EdKcPVvVi1f6R4s9E3BplhLMbdp8U= Received: by 10.103.206.4 with SMTP id i4mr2336390muq.69.1218121531464; Thu, 07 Aug 2008 08:05:31 -0700 (PDT) Received: by 10.102.247.18 with HTTP; Thu, 7 Aug 2008 08:05:30 -0700 (PDT) Message-ID: Date: Thu, 7 Aug 2008 11:05:30 -0400 From: "Merlin Moncure" To: dforums Subject: Re: Plz Heeeelp! performance settings Cc: "Richard Huxton" , pgsql-performance@postgresql.org In-Reply-To: <489AF8E8.6070503@vieonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <35FABCF85D99464FB00BC5123DC2A70A051D0FB8@s228130hz1ew09.apptix-01.savvis.net> <1240.1217440309@sss.pgh.pa.us> <1217441061.6288.47.camel@localhost> <489A21C2.8060801@vieonet.com> <489AA5B5.9080109@vieonet.com> <489AB375.3090901@archonet.com> <489ABC8F.4030007@vieonet.com> <489AD118.5010902@archonet.com> <489AF8E8.6070503@vieonet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/43 X-Sequence-Number: 30924 On Thu, Aug 7, 2008 at 9:30 AM, dforums wrote: > The performance problem is really only on the insertion and even more on the > treatment for the aggregation. > > To treat the 3000 entrances and to insert, or update the tables it needs 10 > minutes. > > As I told you I inject 14000 query every 2 minutes, and it needs 10 minutes > to treat 3000 of those query. > > As you can easly understand it's a big narrow section. > > I'm not doing the treatment in ones, cause I can't, but all is managed by > procedure. > >> That wasn't a yes/no question. Please choose one of: >> Are you updating 6Go per week? most of update >> Are you adding 6Go per week? less of injection, > > This action depend if the data are already present in the database. > > >> >> OK. I assume you're happy with the plans you are getting on these >> queries, since you've not provided any information about them. > > The plan seems ok as it use index as well. > here is the plan : > > explain analyse SELECT "insertUpdateTracks"(137,2605, 852, ('2008-08-06 > 19:28:54'::text)::date,3,'dailydisplay',2,NULL); > INFO: method 1 > QUERY PLAN > ------------------------------------------------------------------------------------ > Result (cost=0.00..0.01 rows=1 width=0) (actual time=1.151..1.151 rows=1 > loops=1) > Total runtime: 1.160 ms > (2 lignes) > > Has you can see the runtime processs for an update in this table. > > multiplying this per 10000, it is too long. > please don't top-post (put your reply after previous comments). With fsync on, you are lucky to get 10k inserts in 10 minutes on single sata 1. The basic issue is that after each time function runs postgesql tells disk drive to flush, guaranteeing data safety. You have few different options here: *) group multiple inserts into single transaction *) modify function to take multiple 'update' records at once. *) disable fsync (extremely unsafe as noted) *) upgrade to 8.3 and disable synchronized_commit (the 'fsync lite', a good compromise between fsync on/off) merlin