X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9A5603A3B0E for ; Fri, 21 Jan 2005 06:03:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55971-03 for ; Fri, 21 Jan 2005 06:03:00 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 22D7A3A4AC0 for ; Fri, 21 Jan 2005 06:03:00 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j0L62xUo012412; Fri, 21 Jan 2005 01:02:59 -0500 (EST) To: Bruno Wolff III Cc: Bernd Heller , pgsql-performance@postgresql.org Subject: Re: column without pg_stats entry?! In-reply-to: <20050121002620.GB16417@wolff.to> References: <11D72EC4-6ACC-11D9-A12E-000A957B8C6E@users.sourceforge.net> <20050121002620.GB16417@wolff.to> Comments: In-reply-to Bruno Wolff III message dated "Thu, 20 Jan 2005 18:26:20 -0600" Date: Fri, 21 Jan 2005 01:02:59 -0500 Message-ID: <12411.1106287379@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.432 tagged_above=0 required=5 tests=AWL, PLING_QUERY X-Spam-Level: X-Archive-Number: 200501/372 X-Sequence-Number: 10062 Bruno Wolff III writes: > Bernd Heller wrote: >> there is no entry in pg_stats for that column at all!! I can only >> suspect that this has to do with the column being all null. > Someone else reported this recently and I think it is going to be fixed. Yeah, this was griped of a little bit ago, but I felt it was too close to 8.0 release to risk fooling with for this cycle. > In the short run you could add an IS NOT NULL clause to your query. > The optimizer doesn't know that < being TRUE implies IS NOT NULL and > so the partial index won't be used unless you add that clause explicitly. Actually, as of 8.0 the optimizer *does* know that. I'm a bit surprised that it didn't pick the partial index, since even without any analyze stats, the small physical size of the partial index should have clued it that there weren't many such tuples. Could we see EXPLAIN output for both cases (both settings of enable_seqscan)? regards, tom lane