Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5E6BE2E3A05 for ; Thu, 13 Dec 2007 19:54:43 -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 60856-08 for ; Thu, 13 Dec 2007 19:54:34 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 6C3782E0294 for ; Thu, 13 Dec 2007 19:54:40 -0400 (AST) Received: from 219-88-219-156.jetstream.xtra.co.nz ([219.88.219.156] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1J2xsy-0003Xy-Oe; Fri, 14 Dec 2007 12:54:36 +1300 Message-ID: <4761C641.30308@opencloud.com> Date: Fri, 14 Dec 2007 12:54:41 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Tom Lane CC: Tom Duffey , pgsql-jdbc@postgresql.org Subject: Re: Slow query after upgrades 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> In-Reply-To: <22413.1197588665@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/104 X-Sequence-Number: 17959 Tom Lane wrote: > It looks pretty obvious from the peanut gallery: in the parameterized > query, the planner daren't choose an indexscan, because for the vast > majority of the possible values of the parameter an indexscan would > suck. 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? From the explain output that just came through it looks like a type mismatch problem on the timestamp parameter. -O