pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nick Fankhauser <nickf@ontko.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Problem with n_distinct being consistently inaccurate.
Date: Tue, 23 Sep 2003 15:26:18 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@ontko.com> (raw)
In-Reply-To: <22043.1064347653@sss.pgh.pa.us>


> 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





view thread (9+ messages)  latest in thread

Message-ID: <NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@ontko.com>
Permalink:  ../NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@ontko.com/
Also on:    postgresql.org/message-id/NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@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: nickf@ontko.com, tgl@sss.pgh.pa.us
  Subject: Re: Problem with n_distinct being consistently inaccurate.
  In-Reply-To: <NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@ontko.com>
  References: <22043.1064347653@sss.pgh.pa.us> <NEBBLAAHGLEEPCGOBHDGKEJAIJAA.nickf@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