pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: William Sescu (Suva) <william.sescu@suva.ch>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: No result when selecting attstattarget from pg_attribute
Date: Thu, 28 Nov 2019 15:23:15 +0100
Message-ID: <c79795a4eef1b7531cdd00b61dc1c4518ddf0506.camel@cybertec.at> (raw)
In-Reply-To: <4078c426dbbb4e18a047ec00485adba9@suva.ch>
References: <4078c426dbbb4e18a047ec00485adba9@suva.ch>

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






view thread (3+ messages)  latest in thread

Message-ID: <c79795a4eef1b7531cdd00b61dc1c4518ddf0506.camel@cybertec.at>
Permalink:  ../c79795a4eef1b7531cdd00b61dc1c4518ddf0506.camel@cybertec.at/
Also on:    postgresql.org/message-id/c79795a4eef1b7531cdd00b61dc1c4518ddf0506.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, william.sescu@suva.ch
  Subject: Re: No result when selecting attstattarget from pg_attribute
  In-Reply-To: <c79795a4eef1b7531cdd00b61dc1c4518ddf0506.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox