Re: relkind='p' has no pg_stat_user_tables

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: relkind='p' has no pg_stat_user_tables
Date: 2018-05-03 15:45:45
Message-ID: 20180503154545.GG9585@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 03, 2018 at 07:44:24AM -0700, Adrian Klaver wrote:
> On 05/03/2018 07:14 AM, Justin Pryzby wrote:
> >I (finally) realized that my script for ANALYZEing parents of table hierarchies
> >every month or so was looping around the same parent tables every night due to
> >no stats for date of last last analysis.
>
> Would help to see the script.

I reproduced it more simply than the 300 line script:

postgres=# CREATE TABLE t(i int)PARTITION BY RANGE(i);
postgres=# CREATE TABLE t1 PARTITION OF t FOR VALUES FROM (1) TO (9);
postgres=# INSERT INTO t1 VALUES(1),(2);
postgres=# ANALYZE VERBOSE t;
postgres=# SELECT * FROM pg_stat_user_tables WHERE relname='t';
(0 rows)
postgres=# SELECT 1 FROM pg_statistic WHERE starelid='t'::regclass;
?column? | 1

Justin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-05-03 16:18:20 Re: relkind='p' has no pg_stat_user_tables
Previous Message Adrian Klaver 2018-05-03 14:44:24 Re: relkind='p' has no pg_stat_user_tables