pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Smet <guillaume.smet@gmail.com>
To: Tom Duffey <tduffey@techbydesign.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Slow query after upgrades
Date: Thu, 13 Dec 2007 22:58:10 +0100
Message-ID: <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com> (raw)
In-Reply-To: <A95A2028-7E3C-4FC1-A911-87BB6E577D54@techbydesign.com>
References: <3EB52707-C945-43D6-9B3F-15F3B228D6F6@techbydesign.com>
	<4761A221.80604@opencloud.com>
	<A95A2028-7E3C-4FC1-A911-87BB6E577D54@techbydesign.com>

On Dec 13, 2007 10:28 PM, Tom Duffey <tduffey@techbydesign.com> wrote:
> The odd thing is that the same query is used in other components of
> the application and we have not noticed any issues.  This led me to
> believe that something about this particular piece is causing the
> problem, possibly external to the query or the JDBC driver.  Running
> the query in psql, for example, doesn't seem slow at all.  So maybe
> it's not a PostgreSQL problem at all but I thought someone might have
> seen this and have some insight into where I should look.

Usual questions: did you analyze your database after loading the dump?

One of the problem you can meet is that the new driver uses protocol
v3 by default, which means that your query are prepared and planned
without the value of the parameters as it was the case using v2 of the
protocol. This can lead in bad plans in specific cases.
You may consider using protocol v2 again if it's your problem by
adding protocolVersion=2 to your JDBC connection URL.

> Is there some logging I can use to compare what is happening on the
> server side when this query is run by the app with the problem vs.
> something else (psql or another of our applications)?

Use log_min_duration_statement in your postgresql.conf (0 if you want
to log every queries).

--
Guillaume



view thread (22+ messages)  latest in thread

Message-ID: <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com>
Permalink:  ../1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com/
Also on:    postgresql.org/message-id/1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: guillaume.smet@gmail.com, tduffey@techbydesign.com
  Subject: Re: Slow query after upgrades
  In-Reply-To: <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com>
  References: <3EB52707-C945-43D6-9B3F-15F3B228D6F6@techbydesign.com> <4761A221.80604@opencloud.com> <A95A2028-7E3C-4FC1-A911-87BB6E577D54@techbydesign.com> <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox