Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ugcnr-0000yE-Qx for pgsql-jdbc@arkaria.postgresql.org; Sun, 26 May 2013 15:24:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ugcnr-0005tR-6E for pgsql-jdbc@arkaria.postgresql.org; Sun, 26 May 2013 15:24:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ugcnq-0005tL-C9 for pgsql-jdbc@postgresql.org; Sun, 26 May 2013 15:24:10 +0000 Received: from cicero3.cybercity.dk ([212.242.43.248]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ugcnm-0003M5-8m for pgsql-jdbc@postgresql.org; Sun, 26 May 2013 15:24:09 +0000 Received: from jukebox.alleroedderne.adsl.dk (port161.ds1-aroe.adsl.cybercity.dk [217.157.138.230]) by cicero3.cybercity.dk (Postfix) with ESMTP id 5AA3F10883A for ; Sun, 26 May 2013 17:24:05 +0200 (CEST) Received: from localhost (jukebox.alleroedderne.adsl.dk [127.0.0.1]) by jukebox.alleroedderne.adsl.dk (Postfix) with ESMTP id ED3586AAC2 for ; Sun, 26 May 2013 17:24:03 +0200 (CEST) X-Virus-Scanned: amavisd-new at alleroedderne.adsl.dk Received: from jukebox.alleroedderne.adsl.dk ([127.0.0.1]) by localhost (jukebox.alleroedderne.adsl.dk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 12CQkvqiNQ50 for ; Sun, 26 May 2013 17:23:58 +0200 (CEST) Received: from kim.alleroedderne.adsl.dk (kim [192.168.0.3]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by jukebox.alleroedderne.adsl.dk (Postfix) with ESMTPS id 384CC6A76C for ; Sun, 26 May 2013 17:23:58 +0200 (CEST) Message-ID: <51A2290D.5050107@alleroedderne.adsl.dk> Date: Sun, 26 May 2013 17:23:57 +0200 From: Kim Bisgaard User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Bound parameters on Linux are extremely slow (compared to unbound and/or Windows) References: <51A14091.7040909@lerner.co.il> In-Reply-To: <51A14091.7040909@lerner.co.il> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.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 Just to make certain that we understand the setup. :-) Machine: A: PG-server OS: ? B: Application client. Linux C: Application client. Windows xx -- Kim On 26-05-2013 00:52, Reuven M. Lerner wrote: > 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 > -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc