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