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 23:52:45 +0100
Message-ID: <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@mail.gmail.com> (raw)
In-Reply-To: <435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com>
References: <3EB52707-C945-43D6-9B3F-15F3B228D6F6@techbydesign.com>
	<4761A221.80604@opencloud.com>
	<A95A2028-7E3C-4FC1-A911-87BB6E577D54@techbydesign.com>
	<1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com>
	<435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com>

On Dec 13, 2007 11:37 PM, Tom Duffey <tduffey@techbydesign.com> wrote:
> foo=> EXPLAIN SELECT point_history.point_id, point_history.timestamp,
> point_history.value, point_history.status FROM point_history WHERE
> point_history.point_id = 21001 AND point_history.timestamp >=
> '2007-12-11 22:22:45' ORDER BY point_history.timestamp DESC;
>                                                   QUERY PLAN
> ------------------------------------------------------------------------------------------------------------
>   Index Scan Backward using point_history_pkey on point_history
> (cost=0.00..264.60 rows=58 width=20)
>     Index Cond: ((point_id = 21001) AND ("timestamp" >= '2007-12-11
> 22:22:45'::timestamp without time zone))
> (2 rows)

It's not an EXPLAIN ANALYZE so we can't see if the query is slow or fast.

If it's fast using the parameters in psql, just try to add
protocolVersion=2 to your JDBC connection URL as I told you earlier.
It should solve your problem. You won't be able to use new features of
protocol v3 but if you used 7.4 before, it shouldn't be a problem for
you.

--
Guillaume



view thread (22+ messages)  latest in thread

Message-ID: <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@mail.gmail.com>
Permalink:  ../1d4e0c10712131452l65841793r449eb3c7cffbf3a5@mail.gmail.com/
Also on:    postgresql.org/message-id/1d4e0c10712131452l65841793r449eb3c7cffbf3a5@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: <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@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> <435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com> <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@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