X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 125BC9FB357 for ; Fri, 8 Sep 2006 11:52:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 00385-06 for ; Fri, 8 Sep 2006 14:52:12 +0000 (UTC) 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 7E4609FB3A1 for ; Fri, 8 Sep 2006 11:46:19 -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 k88EkGPd008115; Fri, 8 Sep 2006 10:46:16 -0400 (EDT) To: fardeen memon cc: pgsql-performance@postgresql.org Subject: Re: Performance problem with joins In-reply-to: <20060908124823.83664.qmail@web60820.mail.yahoo.com> References: <20060908124823.83664.qmail@web60820.mail.yahoo.com> Comments: In-reply-to fardeen memon message dated "Fri, 08 Sep 2006 05:48:23 -0700" Date: Fri, 08 Sep 2006 10:46:16 -0400 Message-ID: <8114.1157726776@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/49 X-Sequence-Number: 20735 fardeen memon writes: > What is it that i am doing wrong? I think the forced coercion to date type in the view case is preventing the planner from making a good guess about the selectivity of the condition on tra_date. It has stats about tra_date's distribution, but none about the distribution of "tra_date::date". regards, tom lane