Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 06D651337B5D for ; Wed, 2 Feb 2011 19:20:23 -0400 (AST) 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 59758-05 for ; Wed, 2 Feb 2011 23:20:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A686F1337B68 for ; Wed, 2 Feb 2011 19:20:15 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p12NKFSR004766; Wed, 2 Feb 2011 18:20:15 -0500 (EST) To: yazan suleiman cc: Maciek Sakrejda , Kevin Grittner , pgsql-jdbc@postgresql.org Subject: Re: Slow statement when using JDBC In-reply-to: References: <4D497D16020000250003A249@gw.wicourts.gov> Comments: In-reply-to yazan suleiman message dated "Wed, 02 Feb 2011 14:11:20 -0800" Date: Wed, 02 Feb 2011 18:20:15 -0500 Message-ID: <4765.1296688815@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/15 X-Sequence-Number: 21413 yazan suleiman writes: > I've done more research. This problem appears at the database level. I > excluded JDBC by running explain anaylze on 2 different statement, the first > is a prepared one The prepared showed the same behavior. Please see below: Try declaring the parameter the same type as the column it's being compared to (which you didn't mention, but I'm guessing it's NUMERIC). regards, tom lane