The setting for the statistics target is saved for each column in the pg_attribute catalog pg_attribute . You can set it like this:
ALTER TABLE myschama.mytable ALTER mycolumn SET STATISTICS 127;
And check it like this:
SELECT attstattarget FROM pg_attribute WHERE attrelid = 'myschama.mytable'::regclass AND attname = 'mycolumn';
Or you just look at the script for creating pgAdmin objects in the browser, where it is added if the value is different from the default in default_statistics_target .
I am quoting the attstattarget :
attstattarget controls the granularity of statistics collected for this ANALYZE column. A value of zero indicates that statistics should not be collected. A negative value indicates the use of a default system statistics target. The exact value of positive values โโdepends on the data type. For scalar data types, attstattarget is both the target number of the โmost common values" to collect and the target number of histogram bins to create.
Bold accent mine.
Erwin Brandstetter Feb 22 '13 at 23:22 2013-02-22 23:22
source share