Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UgNmS-0002ad-W8 for pgsql-jdbc@arkaria.postgresql.org; Sat, 25 May 2013 23:21:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UgNmG-0005I9-5Z for pgsql-jdbc@arkaria.postgresql.org; Sat, 25 May 2013 23:21:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UgNmF-0005I4-JJ for pgsql-jdbc@postgresql.org; Sat, 25 May 2013 23:21:31 +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 1UgNmA-0003fu-93 for pgsql-jdbc@postgresql.org; Sat, 25 May 2013 23:21:30 +0000 Received: by lerner.co.il (Postfix, from userid 1003) id D07BA5D64A3; Sun, 26 May 2013 02:21:25 +0300 (IDT) X-DKIM: Sendmail DKIM Filter v2.8.3 lerner.co.il D07BA5D64A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lerner.co.il; s=MAILOUT; t=1369524085; bh=3cpzPoj9PWFiGDuc72NurIJdCtfZK22LpaW7tLb63Qg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=WK4GSQ+u+Rh+w5p1MSPPlazzpEU86K0cSb92xkHJB+lVelqiRECbvLGginfv9BKFC EXJFxLDNPnBDhu0Ero+sByz8NA0mjC64iJNe8HHoS2OH/gXXqkYL80WVPZA82UG1FC e/ESQjF3HfBb1AfsE6f9FlQ8xX8Vw/J0sQ4siWVY= 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 437875D64A3; Sun, 26 May 2013 02:21:16 +0300 (IDT) X-DKIM: Sendmail DKIM Filter v2.8.3 lerner.co.il 437875D64A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lerner.co.il; s=MAILOUT; t=1369524077; bh=3cpzPoj9PWFiGDuc72NurIJdCtfZK22LpaW7tLb63Qg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=eYWbYa7qZUkFLMMYefnsf4xbWwWsZ9OJZ27xbDLQ56Oc4uno1uTc5JWpDE+qcEAdG YjjnxGNvzhLZx9IQ82rp0jDtuJRLUGIZwXT4r6KG5Q6hfh0BbIXr1qN4OWb+elMs+k /N1qyRAQ4L45+jvC1FymTM3KbSzZgRuyJHYHsxw8= Message-ID: <51A14769.1080409@lerner.co.il> Date: Sun, 26 May 2013 02:21:13 +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: Dave Cramer CC: List Subject: Re: Bound parameters on Linux are extremely slow (compared to unbound and/or Windows) References: <51A14091.7040909@lerner.co.il> In-Reply-To: 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, Dave. Thanks for the response. You wrote: > The problem lies in the fact that JDBC uses an unnamed statement to do > the query. The planner can't plan these very well as the parameters are > not available at plan time. Is there any way to avoid this, and to give the planner more hints? Is there an option in JDBC that can give us a more direct connection? > > This does not explain the slowness on linux however. Is postgresql tuned > on linux, or windows ? The tuning suggestions that I've given were pretty plain overall, and mostly involved changing the amounts given to shared_buffers and effective_cache_size. I know that I gave them suggestions for the Linux box, so if any tuning was done, it was actually there. I was quite surprised to hear that they were even trying it on Windows, let alone that it gave significantly better performance. On the Linux side, they've switched from ext3 to (non-journaled) ext2, to improve performance. Execution is excellent on Linux, except via JDBC and bound parameters. Any other suggestions regarding the differences between Windows and Linux? As you can imagine, this is really puzzling me (er, us). 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