X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id DB32D9FA1A8 for ; Tue, 13 Jun 2006 22:50:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 65150-04 for ; Tue, 13 Jun 2006 22:50:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6F79A9FA38F for ; Tue, 13 Jun 2006 22:50:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k5E1on1X018668; Tue, 13 Jun 2006 21:50:49 -0400 (EDT) To: "Jim C. Nasby" cc: Shaun Thomas , pgsql-performance@postgresql.org Subject: Re: Confirmation of bad query plan generated by 7.4 In-reply-to: <20060613223950.GK34196@pervasive.com> References: <9119.1150222168@sss.pgh.pa.us> <448EDFC4.8F27.00A9.0@leapfrogonline.com> <20060613211347.GB34196@pervasive.com> <10918.1150236282@sss.pgh.pa.us> <20060613223950.GK34196@pervasive.com> Comments: In-reply-to "Jim C. Nasby" message dated "Tue, 13 Jun 2006 17:39:51 -0500" Date: Tue, 13 Jun 2006 21:50:49 -0400 Message-ID: <18667.1150249849@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/232 X-Sequence-Number: 19589 "Jim C. Nasby" writes: > On Tue, Jun 13, 2006 at 06:04:42PM -0400, Tom Lane wrote: >> It'd depend on the context, possibly, but it's easy to show that the >> current planner does fold "now() - interval_constant" when making >> estimates. Simple example: > Turns out the difference is between feeding a date vs a timestamp into the > query... I would have thought that since date is a date that the WHERE clause > would be casted to a date if it was a timestamptz, but I guess not... Hmm ... worksforme. Could you provide a complete test case? regards, tom lane