Re: Analyzer is clueless - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Analyzer is clueless
Date
Msg-id 200411171741.16515.josh@agliodbs.com
Whole thread Raw
In response to Re: Analyzer is clueless  ("Jim C. Nasby" <decibel@decibel.org>)
Responses Re: Analyzer is clueless
List pgsql-performance
Jim,

> Is there still a good reason to have the histogram stats so low? Should
> the default be changed to more like 100 at this point?

Low overhead.  This is actually a TODO for me for 8.1.   I need to find some
test cases to set a differential level of histogram access for indexed
fields, so like 10 for most fields but 100/150/200 for indexed fields.

However, I got stalled on finding test cases and then ran out of time.

> Also, how extensively does the planner use n_distinct, null_frac,
> reltuples and the histogram to see what the odds are of finding a unique
> value or a low number of values? I've seen cases where it seems the
> planer doesn't think it'll be getting a unique value or a small set of
> values even though stats indicates that it should be.
>
> One final question... would there be interest in a process that would
> dynamically update the histogram settings for tables based on how
> distinct/unique each field was?

Well, the process by which the analyzer decides that a field is unique could
probably use some troubleshooting.   And we always, always could use
suggestions/tests/help with the query planner.

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Analyzer is clueless
Next
From: Tom Lane
Date:
Subject: Re: Analyzer is clueless