Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UgNK3-0008Q8-2M for pgsql-jdbc@arkaria.postgresql.org; Sat, 25 May 2013 22:52:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UgNK2-0002jf-GA for pgsql-jdbc@arkaria.postgresql.org; Sat, 25 May 2013 22:52:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UgNK0-0002jS-Fg for pgsql-jdbc@postgresql.org; Sat, 25 May 2013 22:52:20 +0000 Received: from server.lerner.co.il ([69.55.231.200] helo=lerner.co.il) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UgNJt-0003Ai-Ua for pgsql-jdbc@postgresql.org; Sat, 25 May 2013 22:52:20 +0000 Received: by lerner.co.il (Postfix, from userid 1003) id 984EF5D65C0; Sun, 26 May 2013 01:52:11 +0300 (IDT) X-DKIM: Sendmail DKIM Filter v2.8.3 lerner.co.il 984EF5D65C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lerner.co.il; s=MAILOUT; t=1369522331; bh=frQocZwUcHozE6oPFSWd5jWUKOcahweqxOC35rvNsLE=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=AZpx/abtu8c4oU/dA69Qf2kybxbIsQUkQlnWY5HHo4aVJ2ImYn1ERxwdFlAtvACKM Z80efG0akiUJKtzDTzxTPzwgsw4fiX1O0QsUhn2NdJ/NzhxCGiJBXAx+96XuxUS3A7 FyydRstKbNOGyHzlqiKxk4FCdGwo0Yi1oNMHVK4Q= X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lerner.co.il X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no version=3.3.2 Received: from MacBookPro.local (bzq-79-183-100-62.red.bezeqint.net [79.183.100.62]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: reuven) by lerner.co.il (Postfix) with ESMTPSA id 857D75D64A3; Sun, 26 May 2013 01:52:04 +0300 (IDT) X-DKIM: Sendmail DKIM Filter v2.8.3 lerner.co.il 857D75D64A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lerner.co.il; s=MAILOUT; t=1369522325; bh=frQocZwUcHozE6oPFSWd5jWUKOcahweqxOC35rvNsLE=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=HI6XnmRKYbtbEZHJ+v9hD2YRsAfBOmDS1k3hPGAxN+6Ak5TT/eXJohwvr90mERT7a GLL9Lbgfxsyvzl6cGxAOvPVcaIhZp45bHtkk2oKxw8w/tDSFovJt0ZL3vitkYA3hw3 xFBElYdfmUrfPPqZTE4HEae/8fHppW5zwpQWcFqw= Message-ID: <51A14091.7040909@lerner.co.il> Date: Sun, 26 May 2013 01:52:01 +0300 From: "Reuven M. Lerner" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Bound parameters on Linux are extremely slow (compared to unbound and/or Windows) Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hi, everyone. A project I'm assisting is connecting to PostgreSQL (9.2) via JDBC. We're experiencing extremely slow query execution, for precisely the same queries, depending on (a) operating system and (b) whether we use bind parameters. We're using two different Red Hat Linux systems (one running RHEL 5, and the other RHEL 6). The machines have 16 GB and 64 GB RAM, respectively, with 4+ GB allocated to shared buffers on each one. However, given that the performance difference is between psql and JDBC, I doubt that these are significant factors. We have two different Java programs (which do 1,000 inserts), each of which we've run 10 times on each of Windows and Linux. The average time needed for running each program is: Windows: 232 ms with binding, 152 ms without binding Linux: 2,233 ms (yes, 2.233 *seconds*) with binding, 176 ms without binding We've also run the same 1,000 inserts via psql on a remote machine, and the timing was quite fast (i.e., like what we saw on the Windows machine). The combination of binding + Linux seems to be the problematic one here, but I'm at a loss for why. I can provide the test programs if they'll help, but I'm first wondering where the problem might lie. Any suggestions or ideas? What additional information (e.g., the test programs) would help to track this problem down? Thanks in advance, Reuven -- Reuven M. Lerner -- Web development, consulting, and training Mobile: +972-54-496-8405 * US phone: 847-230-9795 http://lerner.co.il * Skype/AIM: reuvenlerner -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc