Re: Query performance PLEASE HELP

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query performance PLEASE HELP
Date: 2003-01-31 20:13:06
Message-ID: 24304.1044043986@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dmitry Tkach <dmitry(at)openratings(dot)com> writes:
> What does NEGATIVE n_distinct mean (for managed_supplier.duns)? :-)

Fractional estimate --- in particular, -1 means it thinks the column
is unique. tradestyle.duns is not really unique by itself, is it?

> It lies about many things... For example - n_distinct for
> tradestyle.name = 385825 is about 100 times small than the actual number
> (which is a little over 30 million)

It might help to raise the statistics target for these columns and
re-ANALYZE. Try 100 or so instead of the default 10.

However, even with these stats I'd think it would pick up on the
tradestyle.name index as a likely thing to use. What was the
database's locale setting, again?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Mitchell 2003-01-31 20:14:46 Re: Basic SQL join question
Previous Message Dmitry Tkach 2003-01-31 20:07:39 Re: Query performance PLEASE HELP