Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAyEk-0004V4-7R for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jan 2022 18:02:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAyEi-0008NC-Us for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jan 2022 18:02:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAyEi-0008N3-I5 for pgsql-hackers@lists.postgresql.org; Fri, 21 Jan 2022 18:02:08 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nAyEe-0003cZ-35 for pgsql-hackers@postgresql.org; Fri, 21 Jan 2022 18:02:07 +0000 Received: by mail-io1-xd2b.google.com with SMTP id p7so11731748iod.2 for ; Fri, 21 Jan 2022 10:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EJWttQIzVQH511FPCG/FgzOZQ+pLUqal9CKO7ZYVdt8=; b=OS6Tz/hDpkCWhwpC6XwK4KlNmujvOqrEkUgCDKMbPRhXOeQnLACZ8W9OTnpIPdukwi cYL4JrkJ31CSbNeuhtnfp5S6oBiO69TaHHFAFTa9E8kXJJ9Z0rsfYaInZiMDOetVxF5b lPqP9DGc4oMhLhh5LPbu+fEay0wa5EqFlVKvYPTSPnTFrIo1zPEow2OzWF0yWXzHQF79 syqYoMfsgb7pgLnxsevE54jqwldqGqTKQVTdMG9TDfRTUjA6ck538NJctMb3UaKjd0BO dzMsK6dmsUZVwZXQQcUMYa4tKd+W9YiqR64pHrIdnOB7f0eyCFmizdSktD3Iv1Vr+2y9 AmCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EJWttQIzVQH511FPCG/FgzOZQ+pLUqal9CKO7ZYVdt8=; b=3aEtE5HAcDmMo2DXd4K+LKR/O3rfvnJNLHgpoddEfMatqY5zTbHOpvzHz7ipiez4J2 WCCH4Z1AxAR8c0uw33HP/TUd+cdbg8hvS9CcXZierQVtXPyPcYipSUWf4UUprwEAwvuK KCSD5i3pQf03mWKsJ36wihAmpRfSIlAwT7TYrYJbBlvTIL522bR8INOpTayaSsiyC5rq zUa29N1q5T6beYvppZ0UZrJmarE7+pHEwqwiA0nTUsRp6jwxbyKXpQ7rqohXgx61hL3R oZqlU183QRmdW2yOhdwHmDJRqlkPXmzIL/6KtZj9t6hsJIR9IEGaoMWZGiub7xTRVE/r xo/A== X-Gm-Message-State: AOAM530ppk0cpU8YIp4Y9mVhuxIX/4pt+fmrLBMXv1pNzy785s2MSG4B 2U3A17UJ7NkgGVjuFpbve3AeDw== X-Google-Smtp-Source: ABdhPJzqI/DACeDBDRctyh/6tKZ/s1vR9RqTHf8ENdHpyFF4Y2ICOaz6eXAgorcNGhaTT9sKLjOYHA== X-Received: by 2002:a5e:9315:: with SMTP id k21mr2612832iom.195.1642788121994; Fri, 21 Jan 2022 10:02:01 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id k8sm3458439ilu.57.2022.01.21.10.02.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jan 2022 10:02:01 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 946AA80226F; Fri, 21 Jan 2022 12:02:00 -0600 (CST) Date: Fri, 21 Jan 2022 12:02:00 -0600 From: Justin Pryzby To: Tomas Vondra Cc: =?iso-8859-1?Q?=C1lvaro?= Herrera , yuzuko , pgsql-hackers@postgresql.org Subject: Re: document the need to analyze partitioned tables Message-ID: <20220121180200.GM23027@telsasoft.com> References: <20210913035409.GA10647@telsasoft.com> <20211008125822.GJ27491@telsasoft.com> <681e76ad-3a7b-ea3c-b6b0-55946239c49b@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <681e76ad-3a7b-ea3c-b6b0-55946239c49b@enterprisedb.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for looking at this On Fri, Jan 21, 2022 at 06:21:57PM +0100, Tomas Vondra wrote: > Hi, > > On 10/8/21 14:58, Justin Pryzby wrote: > > Cleaned up and attached as a .patch. > > > > The patch implementing autoanalyze on partitioned tables should > > revert relevant portions of this patch. > > I went through this patch and I'd like to propose a couple changes, per the > 0002 patch: > > 1) I've reworded the changes in maintenance.sgml a bit. It sounded a bit > strange before, but I'm not a native speaker so maybe it's worse ... + autoanalyze on the parent table. If your queries require statistics on + parent relations for proper planning, it's necessary to periodically run You added two references to "relations", but everything else talks about "tables", which is all that analyze processes. > 2) Remove unnecessary whitespace changes in perform.sgml. Those were a note to myself and to any reviewer - should that be updated too ? > 3) Simplify the analyze.sgml changes a bit - it was trying to cram too much > stuff into a single paragraph, so I split that. > > Does that seem OK, or did omit something important? + If the table being analyzed has one or more children, I think you're referring to both legacy inheritance and and partitioning. That should be more clear. + ANALYZE gathers two sets of statistics: once on the rows + of the parent table only, and a second one including rows of both the parent + table and all child relations. This second set of statistics is needed when I think should say ".. and all of its children". > FWIW I think it's really confusing we have inheritance and partitioning, and > partitions and child tables. And sometimes we use partitioning in the > generic sense (i.e. including the inheritance approach), and sometimes only > the declarative variant. Same for partitions vs child tables. I can't even > imagine how confusing this has to be for people just learning this stuff. > They must be in permanent WTF?! state ... The docs were cleaned up some in 0c06534bd. At least the word "partitioned" should never be used for legacy inheritance - but "partitioning" is. -- Justin