Skip site navigation (1) Skip section navigation (2)

Re: Are statistics gathered on function indexes?

From: Ray Ontko <rayo(at)ontko(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ray Ontko <rayo(at)ontko(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Are statistics gathered on function indexes?
Date: 2002-06-28 20:42:01
Message-ID: 200206282042.PAA07634@shire.ontko.com (view raw or flat)
Thread:
Lists: pgsql-admin
Tom,

> Ray Ontko <rayo(at)ontko(dot)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(at)ontko(dot)com   Phone 1.765.935.4283   Fax 1.765.962.9788
Ray Ontko & Co.   Software Consulting Services   http://www.ontko.com/



In response to

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2002-06-28 20:50:47
Subject: Re: Are statistics gathered on function indexes?
Previous:From: Tom LaneDate: 2002-06-28 20:36:24
Subject: Re: Are statistics gathered on function indexes?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group