pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ray Ontko <rayo@ontko.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ray Ontko <rayo@ontko.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Are statistics gathered on function indexes?
Date: Fri, 28 Jun 2002 15:42:01 -0500 (EST)
Message-ID: <200206282042.PAA07634@shire.ontko.com> (raw)
In-Reply-To: <9389.1025296584@sss.pgh.pa.us>

Tom,

> Ray Ontko <rayo@ontko.com> writes:
> > 1) here's the "bad" stats.
> > 2) here's the "good" stats.
> > Note that the information really is different.
> 
> Yeah.  It seems that the critical difference is the null_frac; if I take
> your "bad" values and change null_frac to 0 then I get
> reasonable-looking answers, but with null_frac = 0.000333333 I indeed
> get bad answers.  I suspect null_frac is getting double-counted
> somewhere, and depending on just how many nulls ANALYZE happens to find,
> you might get pushed over the edge from a small selectivity to zero or
> negative selectivity.  Will dig further.

Does this help?

develop=# select count(*) from actor where actor_full_name is not null ;
 count
--------
 433809
(1 row)

develop=# select count(*) from actor ;
 count
--------
 433902
(1 row)

Ray
----------------------------------------------------------------------
Ray Ontko   rayo@ontko.com   Phone 1.765.935.4283   Fax 1.765.962.9788
Ray Ontko & Co.   Software Consulting Services   http://www.ontko.com/





view thread (23+ messages)  latest in thread

Message-ID: <200206282042.PAA07634@shire.ontko.com>
Permalink:  ../200206282042.PAA07634@shire.ontko.com/
Also on:    postgresql.org/message-id/200206282042.PAA07634@shire.ontko.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rayo@ontko.com, tgl@sss.pgh.pa.us
  Subject: Re: Are statistics gathered on function indexes?
  In-Reply-To: <200206282042.PAA07634@shire.ontko.com>
  References: <9389.1025296584@sss.pgh.pa.us> <200206282042.PAA07634@shire.ontko.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox