Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aWlcm-0005JM-Gz for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2016 14:01:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aWlcm-00065w-3e for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2016 14:01:36 +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 1aWlcl-00064F-5n for pgsql-admin@postgresql.org; Fri, 19 Feb 2016 14:01:35 +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 1aWlci-0003jR-97 for pgsql-admin@postgresql.org; Fri, 19 Feb 2016 14:01:34 +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 u1JE1NRj012849; Fri, 19 Feb 2016 09:01:23 -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> <11677.1455888766@sss.pgh.pa.us> Comments: In-reply-to nunks message dated "Fri, 19 Feb 2016 11:51:53 -0200" Date: Fri, 19 Feb 2016 09:01:23 -0500 Message-ID: <12848.1455890483@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: > I deal with some big (TB-level) partitioned tables where the application > does a hybrid of querying both the master and the child tables directly. > This clarification will be very useful. BTW, the autovacuum daemon is normally fairly good about analyzing tables when the individual-table stats need updating (or if you think it isn't, you can adjust its parameters to make it more or less aggressive about that). Where it falls down is actually in maintenance of whole-tree stats: it does not realize that a bunch of updates on a child table should prompt auto-analyze of the parent table as well as the child. So I'd actually not think that you need to worry too much about manual ANALYZEs of the children. You might indeed need to help things out with periodic manual ANALYZEs of the parent table, though. 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