Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7ED532E035F for ; Thu, 13 Dec 2007 18:52:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 49518-01 for ; Thu, 13 Dec 2007 18:52:42 -0400 (AST) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.188]) by postgresql.org (Postfix) with ESMTP id 2A7792E030E for ; Thu, 13 Dec 2007 18:52:46 -0400 (AST) Received: by mu-out-0910.google.com with SMTP id i10so1400307mue.3 for ; Thu, 13 Dec 2007 14:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=KIYhk3S9hmJlpQgYOZfT6+tzoXRF9dyf+cMCeM0QKSk=; b=FW5ML1oDGOimPp/LQR2T88LldUXEKWZIPsUHOkYZCj/h5H93Fh+6qkklv11ocD5yJdazKxjfpE1G+hFEru0KbKQOrW/85zn0DWf83ho1nOVmFDNMOooMoPuh5nwpR6gqqT3AtqmfkMN+caahvBFA0YLsJzWGFHC6A2A7Lw+yppc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g/a6ltuyDY2g3AHK7kjdsPHPyUGC4yXqQkm6WyLg74dJMxy+sTgGM12MUaa1ZgWm2Tlu+OpdCOhA8Tcwx64aHqLIwXwB9xzLB8evFjUrkm0tgzpgH/QRQ+4P8BoQYLArWxqN4UyqyPWv+8gU2ZbAcgAYgJjT31VgoScPni+C1yQ= Received: by 10.82.138.6 with SMTP id l6mr6699714bud.20.1197586365421; Thu, 13 Dec 2007 14:52:45 -0800 (PST) Received: by 10.82.120.6 with HTTP; Thu, 13 Dec 2007 14:52:45 -0800 (PST) Message-ID: <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@mail.gmail.com> Date: Thu, 13 Dec 2007 23:52:45 +0100 From: "Guillaume Smet" To: "Tom Duffey" Subject: Re: Slow query after upgrades Cc: pgsql-jdbc@postgresql.org In-Reply-To: <435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3EB52707-C945-43D6-9B3F-15F3B228D6F6@techbydesign.com> <4761A221.80604@opencloud.com> <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com> <435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/99 X-Sequence-Number: 17954 On Dec 13, 2007 11:37 PM, Tom Duffey 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