Re: No result when selecting attstattarget from pg_attribute

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: No result when selecting attstattarget from pg_attribute
Дата
Msg-id c79795a4eef1b7531cdd00b61dc1c4518ddf0506.camel@cybertec.at
обсуждение исходный текст
Ответ на No result when selecting attstattarget from pg_attribute  ("William Sescu (Suva)" <william.sescu@suva.ch>)
Список pgsql-admin
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
attnamein ('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




В списке pgsql-admin по дате отправления:

Предыдущее
От: "William Sescu (Suva)"
Дата:
Сообщение: No result when selecting attstattarget from pg_attribute
Следующее
От: Tom Lane
Дата:
Сообщение: Re: No result when selecting attstattarget from pg_attribute