Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aWlB8-000336-IQ for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2016 13:33:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aWlB7-0003eS-Q8 for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2016 13:33:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aWlB7-0003du-1t for pgsql-admin@postgresql.org; Fri, 19 Feb 2016 13:33:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aWlB4-00034G-1h for pgsql-admin@postgresql.org; Fri, 19 Feb 2016 13:33:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u1JDWk3s011678; Fri, 19 Feb 2016 08:32:46 -0500 From: Tom Lane To: nunks cc: "gaoqiangdba@163.com" , pgsql-admin Subject: Re: ANALYZE'ing table hierarchies In-reply-to: References: <201602191441422069485@163.com> Comments: In-reply-to nunks message dated "Fri, 19 Feb 2016 09:48:36 -0200" Date: Fri, 19 Feb 2016 08:32:46 -0500 Message-ID: <11677.1455888766@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org nunks writes: > What eludes me is that part of the documentation says we should analyze > each table individually, and another part says we can count on ANALYZE to > work on the entire inheritance tree... Whole-tree stats are a different thing from per-table stats. What ANALYZE on a parent table produces is (1) stats for that table alone and (2) summary stats for the whole inheritance tree rooted at that table. If you want (3) stats for a child table alone then you need to ANALYZE that child table by name. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin