Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fEFTP-0003Ug-K9 for pgsql-general@arkaria.postgresql.org; Thu, 03 May 2018 14:44:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fEFTJ-0000H2-83 for pgsql-general@arkaria.postgresql.org; Thu, 03 May 2018 14:44:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fEFTH-0000Go-Cl for pgsql-general@lists.postgresql.org; Thu, 03 May 2018 14:44:37 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fEFTA-0003fS-41 for pgsql-general@postgresql.org; Thu, 03 May 2018 14:44:34 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 74B7222552; Thu, 3 May 2018 10:44:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 03 May 2018 10:44:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=BdlVWx35joiphVy0hDUQb/j6biLLP NJo3qe6dTYMUNg=; b=kbJnp6Kt1YcHSw//SMEezUuu9857j8WvOi+syYu3XvcEl SHtMf28mOjaIZ/+3Mpjd1LcLtamE9pYYGflJitgy8bNQw+Z5Art2CYxApQa40aLR U58mr8QqC9yYA2Pu+049+Q3H8m/PUKEpfe0XrdGwtCXN8sWD16P6Uuldl0b30xJY oanSetbh/wHbQLhssFwJBFoDqUyN0Pya32L+k1Gwm5VJqdthgWykv0GW2me/fVRv tKvIsNyYdhyqctvJlZ0X1oUBce71ZRTJzsdasOmGDe//YT6dktol6j5EzSip4KgT PMvTqISYeaT9JSex+3fwtCahV/j0qeT/yIe8QsVmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=BdlVWx 35joiphVy0hDUQb/j6biLLPNJo3qe6dTYMUNg=; b=Y5/AUihtjVUP7EghIXoH3Z W45RWuwMNXXwxnPJ4IL01g7LquwWiVmcoiKAyQoOMcY4gIa448nLyzyL/4GisTh/ EUvcd1Rhq+6JTBZOpzvl0mdnxrSrRZKiPSRDe/byjdkPK71EZeUqdNoQ9lWFFvr8 9ovwNbNe/72kDvLRNN2iRHzgfcyKMGr2sBlD5DU5+gs9FihugLEnT4Z3WyHnzOAK K55c280qmF2xh6yU9VEGQnuWHWmiVNqFYdF9ZICfJojt2YgchbLgMl38P9UBtS+v uPxrt1V2ZuqEKAwo9ikoXA7RtJe+GAxfhkNS/kvBXKi7qS/iyCBBsYCeXvunLiPw == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A759E444A; Thu, 3 May 2018 10:44:25 -0400 (EDT) Subject: Re: relkind='p' has no pg_stat_user_tables To: Justin Pryzby , pgsql-general@postgresql.org References: <20180503141430.GA28019@telsasoft.com> From: Adrian Klaver Message-ID: <5e1e8ccf-da3d-5277-df77-a2bbaa714592@aklaver.com> Date: Thu, 3 May 2018 07:44:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180503141430.GA28019@telsasoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 guess that's deliberate/known and maybe related to relkind='p' having no > relfilenode. Not sure that is an issue as pg_stat_user uses relid not relfilenode: https://www.postgresql.org/docs/10/static/monitoring-stats.html#PG-STAT-ALL-TABLES-VIEW For reasons why they are often not the same: https://www.postgresql.org/docs/10/static/storage-file-layout.html " Caution Note that while a table's filenode often matches its OID, this is not necessarily the case; some operations, like TRUNCATE, REINDEX, CLUSTER and some forms of ALTER TABLE, can change the filenode while preserving the OID. Avoid assuming that filenode and table OID are the same. Also, for certain system catalogs including pg_class itself, pg_class.relfilenode contains zero. The actual filenode number of these catalogs is stored in a lower-level data structure, and can be obtained using the pg_relation_filenode() function. " > > Is there any good workaround other than making stampfiles or making my own > "last analyzed" table? > > Thanks, > Justin > > -- Adrian Klaver adrian.klaver@aklaver.com