Re: Slow statement when using JDBC

From: Maciek Sakrejda <msakrejda(at)truviso(dot)com>
To: yazan suleiman <yazan(dot)suleiman(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Slow statement when using JDBC
Date: 2011-02-02 20:32:37
Message-ID: AANLkTik5eqiMj-GZDahLJ1HiL==xfQGxp-wZbxJwnBws@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

My guess is the named (as opposed to anonymous) server-side prepared
statements kick in and the planning is happening sans parameters (see
the prepareThreshold connection parameter--see
http://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters
), leading to a seq scan. Is it by chance only happening on the fifth
invocation of that statement? Or are you changing prepareThreshold? If
that's the case, you may want to bump prepareThreshold so that you
never get a named statement here. If this is happening right off the
bad and you're not mucking with the threshold, something more
interesting is going on and we'd need more details on your Java code.

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
www.truviso.com

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message yazan suleiman 2011-02-02 21:27:25 Re: Slow statement when using JDBC
Previous Message yazan suleiman 2011-02-02 19:38:17 Slow statement when using JDBC