Ghislain ROUVIGNAC wrote: >> I would leave default_statistics_target alone unless you see a lot of >> estimates which are off by more than an order of magnitude. Even then, it >> is often better to set a higher value for a few individual columns than for >> everything. > > > We had an issue with a customer where we had to increase the statistics > parameter for a primary key. > So I'd like to know if there is a way to identify for which column we have > to change the statistics. I don't know a better way than to investigate queries which seem to be running longer than you would expect, and look for cases where EXPLAIN ANALYZE shows an estimated row count which is off from actual by enough to cause a problem. Sometimes this is caused by correlations between values in different columns, in which case a higher target is not likely to help; but sometimes it's a matter that there is an uneven distribution among values not included in the "most common values", in which case boosting the target to store more values and finer-grained information on ranges will be exactly what you need. -Kevin -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance