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 1mFl5g-00043l-Ei for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Aug 2021 22:28:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mFl5d-0006P2-UT for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Aug 2021 22:28:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFl5d-0006Ol-JJ for pgsql-hackers@lists.postgresql.org; Mon, 16 Aug 2021 22:28:17 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mFl5Z-00065g-Hk for pgsql-hackers@lists.postgresql.org; Mon, 16 Aug 2021 22:28:16 +0000 Received: by mail-io1-xd2e.google.com with SMTP id i7so25137394iow.1 for ; Mon, 16 Aug 2021 15:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=UAne7bpNRXOvM6P0X+lLDBwHLMyA8vX9dMYocLctik4=; b=hnNCL8naJpZ53IuUfXB0sZ737ce8KUzL9neHcQ4MD5o8oQFqm210qnvw5qPpCyqDuu Ku56//KpPxxFQqvtcU1wyqQIx8vgxP8If1kUib2KusXmckGIM/0B8UdXcFcwM+8wEQEf zHg9QO5fmvauwlHe7X7LRUfe0zHTBVYHAjkNFy3fSgCoHGmZGx3BVgVMwOazd0hwnWG+ 8Jujh71M51tMX+jzymcGt4n9jRrJu2h2gbtig/l+gls+0XxU255MDOCbGQ88d7y/I6+m UfJUBtQ9zxFC96PqtqiGbICoFTtdy9VGuvMcI9DGFLzy6Ug9+40b/nZrr5QtzcSgbV0T gPrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=UAne7bpNRXOvM6P0X+lLDBwHLMyA8vX9dMYocLctik4=; b=oTT5FVE5EbHSEvfewc3qgQKb0PGKAoAeK0tQfxb0aVxz+z6Lt5L4rcgSLUcpINrJ5S 4TBHDF+/7ahjlZvfMkvPmCKwD1ya7q23i8V4UR3hpOkenCm6obVwAyv/sp8tamyO3jrw TWHkQ3NHXUhDArJApTEB8oOrJbE7zExcdm/lsMZ6Tpe0wzaqYdS2HH/s3sojLfrJiiK5 Kh2nv6bwmAx/MYhb6zvYfh6Q5vBrYNnbwWX7Z3sjcsXzxmLnioRfbvM6hR7ygspnR6FM eMsNx7B+f1XyCACN5Qv04dgSRgg1CPxt6Dwc9+UXdGpnlsKq6eefBZWDYhJ+xc4Dx10/ MRGA== X-Gm-Message-State: AOAM533+H3ZzlXDsB2nMI98meY+kUpSXJJdQkxnh2XsDIIuqQf+1+/5h NboOiy8d7OXgs5v/1CykHZVLmw== X-Google-Smtp-Source: ABdhPJzIL/dYbN8ikaQjJbg3MEa5+wXHwpSdwnl+Y+0bPt5w2NbuyGDegD0OJ2EyFxHyfsTA7G9OHA== X-Received: by 2002:a02:860d:: with SMTP id e13mr140653jai.12.1629152892500; Mon, 16 Aug 2021 15:28:12 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id z22sm118867ioe.52.2021.08.16.15.28.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Aug 2021 15:28:12 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 1484980159A; Mon, 16 Aug 2021 17:28:11 -0500 (CDT) Date: Mon, 16 Aug 2021 17:28:10 -0500 From: Justin Pryzby To: =?iso-8859-1?Q?=C1lvaro?= Herrera Cc: Andres Freund , Kyotaro HORIGUCHI , yuzuko , Tomas Vondra , David Steele , Kyotaro Horiguchi , Daniel Gustafsson , Amit Langote , Masahiko Sawada , Laurenz Albe , "pgsql-hackers@lists.postgresql.org" , Greg Stark Subject: Re: Autovacuum on partitioned table (autoanalyze) Message-ID: <20210816222810.GE10479@telsasoft.com> References: <202108161546.3zuouk76skr4@alvherre.pgsql> <202108162142.crk2myigb2ad@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202108162142.crk2myigb2ad@alvherre.pgsql> 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 On Mon, Aug 16, 2021 at 05:42:48PM -0400, Álvaro Herrera wrote: > On 2021-Aug-16, Álvaro Herrera wrote: > > > Here's the reversal patch for the 14 branch. (It applies cleanly to > > master, but the unused member of PgStat_StatTabEntry needs to be > > removed and catversion bumped). > > I have pushed this to both branches. (I did not remove the item from > the release notes in the 14 branch.) | I retained the addition of relkind 'p' to tables included by | pg_stat_user_tables, because reverting that would require a catversion | bump. Right now, on v15dev, it shows 0, which is misleading. Shouldn't it be null ? analyze_count | 0 Note that having analyze_count and last_analyze would be an an independently useful change. Since parent tables aren't analyzed automatically, I have a script to periodically process them if they weren't processed recently. Right now, for partitioned tables, the best I could find is to check its partitions: | MIN(last_analyzed) FROM pg_stat_all_tables psat JOIN pg_inherits i ON psat.relid=i.inhrelid In 20200418050815.GE26953@telsasoft.com I wrote: |This patch includes partitioned tables in pg_stat_*_tables, which is great; I |complained awhile ago that they were missing [0]. It might be useful if that |part was split out into a separate 0001 patch (?). | [0] https://www.postgresql.org/message-id/20180601221428.GU5164%40telsasoft.com -- Justin