Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 594274774A0 for ; Fri, 28 Jun 2002 16:57:44 -0400 (EDT) Mailbox-Line: From tgl@sss.pgh.pa.us Fri Jun 28 16:57:44 2002 Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 3A5AE4774D5 for ; Fri, 28 Jun 2002 16:50:47 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5SKolD09558; Fri, 28 Jun 2002 16:50:47 -0400 (EDT) To: Ray Ontko Cc: pgsql-admin@postgresql.org Subject: Re: Are statistics gathered on function indexes? In-reply-to: <200206282042.PAA07634@shire.ontko.com> References: <200206282042.PAA07634@shire.ontko.com> Comments: In-reply-to Ray Ontko message dated "Fri, 28 Jun 2002 15:42:01 -0500" Date: Fri, 28 Jun 2002 16:50:47 -0400 Message-ID: <9555.1025297447@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-4.3 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,SUBJ_ENDS_IN_Q_MARK,DOUBLE_CAPSWORD version=2.30 X-Spam-Level: X-Archive-Number: 200206/246 X-Sequence-Number: 4679 Ray Ontko writes: > Does this help? Well, it says that ANALYZE is not doing anything wrong ;-). The true null_frac given those numbers is 1.0 - 433809.0/433902.0 or about 0.000214. In the default ANALYZE sample size (3000 rows) the statistical expectation would be 0.643 NULLs, so most of the time ANALYZE is going to find 1 NULL, sometimes no NULLs, and rarely more than 1 NULL. Most of the time you'll get null_frac = 1/3000 = 0.000333333, sometimes 0, etc. The stats themselves look fine to me; I think there must be a mathematical error in what selfuncs.c is doing with them. Still looking to find it... regards, tom lane