Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7B347B5DBF0 for ; Fri, 8 Jul 2011 08:23:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 79408-08 for ; Fri, 8 Jul 2011 11:23:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm13-vm0.bullet.mail.sp2.yahoo.com (nm13-vm0.bullet.mail.sp2.yahoo.com [98.139.91.244]) by mail.postgresql.org (Postfix) with SMTP id DCE0DB5DBE9 for ; Fri, 8 Jul 2011 08:23:10 -0300 (ADT) Received: from [98.139.91.63] by nm13.bullet.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 11:23:10 -0000 Received: from [98.139.91.20] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 11:23:10 -0000 Received: from [127.0.0.1] by omp1020.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 11:23:10 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 164805.77124.bm@omp1020.mail.sp2.yahoo.com Received: (qmail 84898 invoked by uid 60001); 8 Jul 2011 11:23:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1310124189; bh=8iI0kE6JluEGfO+t8pqjqFJ/y6g6KmrA3JYGzJe1QRk=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=c19eQP5rSrBua1ULRe8J1abY/b03x38orSM2+XUUnotcC4lWTXy+h+A3Ke6ZctM8xXiMCtNLRNdFwpbfewyqv6pldJhyXgZuOhm/aFRgOPzhTsQxa60fWYNYLZtBpGD3Axtno9HsjCOrAl9lKQYhOVH/GsaEA6ojhi6erGNlx2w= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=skPTgC330Pjm255TnJL2BMIWDLbnHU8YD+6kEyzXo8hs0ObrRG+ficWlppJHk6XY2KEkijDJI2nMXgXBdVxTDSfNwvI6nGuN+tw1iLJQmMt3iR6FstCaj0fCgkkgtj7Ea8rCg4wHY0QssWXeok3MlW2RaxGgjVPaiLtJaHhs4jU=; X-YMail-OSG: 0Zz6akUVM1mPrwxvii8_xoFBGQ2jzeJaZ03Ror4UVrMwdd7 5IXY4tYtu24CK2CXTBKxua2CPayk98fx.ci6zP8kDZNuX8VCxaKVESVCiYc_ MtAilexv_TvMHdKn6K0QR585gZIy2uncGyAANZd8x9EjA766KfwEY8LHQHcA GABzTgyIL0RDD8MTRGBMVX5WRuOdFchr6A4x.b7KYkzbxO62OprOjkMRIBs0 wsnwOWm2IyAYca7bNxkYQ7McoVRvvQEanyUncDZrbpHAkd5s4z60oUNyU7ck kqxrDMTp1C5tNa8PsJun1b57zsrxpVuE_IqjaFbiqC4E.cb6hPqkMUbbc4IL ciDc63qunkdfXYqJLLf8D4g.wY4Fdk2vh1fJUKuuhkoTOXThCjR3AF0B6pGx pFzXRweBmuqOTcg-- Received: from [145.253.157.4] by web39303.mail.mud.yahoo.com via HTTP; Fri, 08 Jul 2011 04:23:09 PDT X-Mailer: YahooMailClassic/14.0.3 YahooMailWebService/0.8.112.307740 Message-ID: <1310124189.79849.YahooMailClassic@web39303.mail.mud.yahoo.com> Date: Fri, 8 Jul 2011 04:23:09 -0700 (PDT) From: Sergio Mayoral Subject: execution time for first INSERT To: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=BAYES_20=-0.001, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201107/40 X-Sequence-Number: 44252 Hi, i am using libpq library and postgresql 8.4 for my linux application running on ARM with 256 MB. I am just doing: PQconnectdb(); PQexec(INSERT INTO table1 ....); (0.009661 sec.) PQexec(INSERT INTO table1 ....); (0.004208 sec.) PQexec(INSERT INTO table2 ....); (0.007352 sec.) PQexec(INSERT INTO table2 ....); (0.002533 sec.) PQexec(INSERT INTO table2 ....); (0.002281 sec.) PQexec(INSERT INTO table2 ....); (0.002244 sec.) PQexec(INSERT INTO table3 ....); (0.006903 sec.) PQexec(INSERT INTO table3 ....); (0.002903 sec.) PQfinnish(); I check the time for each PQexec with gettimeofday function and I always see that the first INSERT for each table needs longer than the next ones. 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. Thanks in advance, sma