pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: relkind='p' has no pg_stat_user_tables
Date: Thu, 3 May 2018 10:45:45 -0500
Message-ID: <20180503154545.GG9585@telsasoft.com> (raw)
In-Reply-To: <5e1e8ccf-da3d-5277-df77-a2bbaa714592@aklaver.com>
References: <20180503141430.GA28019@telsasoft.com>
	<5e1e8ccf-da3d-5277-df77-a2bbaa714592@aklaver.com>

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




view thread (10+ messages)  latest in thread

Message-ID: <20180503154545.GG9585@telsasoft.com>
Permalink:  ../20180503154545.GG9585@telsasoft.com/
Also on:    postgresql.org/message-id/20180503154545.GG9585@telsasoft.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pryzby@telsasoft.com, adrian.klaver@aklaver.com
  Subject: Re: relkind='p' has no pg_stat_user_tables
  In-Reply-To: <20180503154545.GG9585@telsasoft.com>
  References: <20180503141430.GA28019@telsasoft.com> <5e1e8ccf-da3d-5277-df77-a2bbaa714592@aklaver.com> <20180503154545.GG9585@telsasoft.com>

* 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