Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2E471B5DBC6 for ; Fri, 8 Jul 2011 21:40:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 08270-04 for ; Sat, 9 Jul 2011 00:40:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id 12445B5DBC1 for ; Fri, 8 Jul 2011 21:40:26 -0300 (ADT) Received: by pzk9 with SMTP id 9so1754244pzk.19 for ; Fri, 08 Jul 2011 17:40:26 -0700 (PDT) Received: by 10.142.55.2 with SMTP id d2mr601064wfa.276.1310172026471; Fri, 08 Jul 2011 17:40:26 -0700 (PDT) Received: from [10.10.3.129] (71-6-94-66.static-ip.telepacific.net [71.6.94.66]) by mx.google.com with ESMTPS id e9sm46606pbh.92.2011.07.08.17.40.24 (version=SSLv3 cipher=OTHER); Fri, 08 Jul 2011 17:40:25 -0700 (PDT) Subject: Re: execution time for first INSERT From: Jeff Davis To: Sergio Mayoral Cc: pgsql-performance@postgresql.org In-Reply-To: <1310124189.79849.YahooMailClassic@web39303.mail.mud.yahoo.com> References: <1310124189.79849.YahooMailClassic@web39303.mail.mud.yahoo.com> Content-Type: text/plain; charset="ISO-8859-1" Date: Fri, 08 Jul 2011 17:40:23 -0700 Message-ID: <1310172023.5376.4.camel@jdavis-ux.asterdata.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201107/49 X-Sequence-Number: 44261 On Fri, 2011-07-08 at 04:23 -0700, Sergio Mayoral wrote: > this must be something with the parser stage and since i am doing > every time the same queries, I would like to know if there is a way to > cache these queries in order to speed up the first INSERT. I doubt it's the parser. Seeing as it's around a couple ms at minimum, it's probably some kind of IO latency. You could see that by wrapping the statements in a big transaction (BEGIN/END block) -- I bet the inserts go very quickly and the final commit takes longer. Regards, Jeff Davis