Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id B0DDA2E3937 for ; Thu, 13 Dec 2007 21:03:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 47463-06 for ; Thu, 13 Dec 2007 21:03:29 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 72F062E3934 for ; Thu, 13 Dec 2007 21:03:29 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lBE13LYW023431; Thu, 13 Dec 2007 20:03:22 -0500 (EST) To: Oliver Jowett cc: Tom Duffey , pgsql-jdbc@postgresql.org Subject: Re: Slow query after upgrades In-reply-to: <4761C641.30308@opencloud.com> References: <3EB52707-C945-43D6-9B3F-15F3B228D6F6@techbydesign.com> <4761A221.80604@opencloud.com> <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com> <435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com> <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@mail.gmail.com> <0116C2A9-8DB5-4EBE-A66B-BE7F2A11651C@techbydesign.com> <4761BACA.4020008@opencloud.com> <22413.1197588665@sss.pgh.pa.us> <4761C641.30308@opencloud.com> Comments: In-reply-to Oliver Jowett message dated "Fri, 14 Dec 2007 12:54:41 +1300" Date: Thu, 13 Dec 2007 20:03:21 -0500 Message-ID: <23430.1197594201@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/108 X-Sequence-Number: 17963 Oliver Jowett writes: > The JDBC driver is using an unnamed statement in this case, shouldn't > the planner end up using index selectivity estimates based on the actual > parameter values? If he's using a recent enough backend, it should. > From the explain output that just came through it looks like a type > mismatch problem on the timestamp parameter. Yeah, no question. Implicit casts to text strike again :-(. He was probably getting the wrong answers, not only a slow query. regards, tom lane