On Thu, 2019-11-28 at 09:55 +0000, William Sescu (Suva) wrote: > Now I create the custom statistics, however, attstattarget is still -1 > > (klb@[local]:55000)[knowledgebase]> CREATE STATISTICS s1 (dependencies) ON a, b FROM t1; > CREATE STATISTICS > > (klb@[local]:55000)[knowledgebase]> select attrelid::regclass as name, attname, attstattarget from pg_attribute where attname in ('a','b'); > name | attname | attstattarget > ------+---------+--------------- > t1 | a | -1 > t1 | b | -1 > (2 rows) > > Am I looking at the wrong view? I am planning to do some upgrades to 12.x, and therefore, I created this little test case > to make sure that I don't forget to set custom statistics on the new version, if there are any. "attstattarget" is set to a value different from -1 if you define a special statistics detail level for the column: ALTER TABLE t1 ALTER a SET STATISTICS 1000; It has nothing to do with extended statistics. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com