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

Re: Problem with n_distinct being consistently inaccurate.

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Problem with n_distinct being consistently inaccurate.
Date: 2003-09-23 20:26:18
Message-ID: NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@ontko.com (view raw or flat)
Thread:
Lists: pgsql-admin
> It certainly should be the case.  starelid matches to pg_class.oid and
> staattnum matches to pg_attribute.attnum.

My problem was that I was looking up "event_date_time" in pg_class.relname
(and finding it), but the oid matched nothing. when I looked for 'event' in
pg_class & 'event_date_time' in pg_attribute, everything became clear.

So... I updated stadistinct to the actual value of 92,000 as you suggested
and as you predicted, it did not change the plan a bit. I guess I'll look
elsewhere for ways to optimize this query.

Thanks!

-Nick



In response to

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2003-09-23 20:34:04
Subject: Re: Problem with n_distinct being consistently inaccurate.
Previous:From: Mark CarewDate: 2003-09-23 20:20:52
Subject: Re: steps to ensure referential integrity

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