Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY7L0-000pWi-Qm for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 16:01:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qY7Kz-0083bO-9h for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 16:01:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY7Ky-0083aq-U4 for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 16:01:04 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY7Kr-000CLh-2p for pgsql-general@postgresql.org; Mon, 21 Aug 2023 16:01:04 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7D0FA5C2714; Mon, 21 Aug 2023 12:00:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 21 Aug 2023 12:00:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1692633654; x=1692720054; bh=DGABjcRsCONd9w7Vij9NyVm0mchfuhqQSpq z4PskzzU=; b=VMEZ7XAdt1y6rgc3QlmA1BiZWtNkwsaJTolW1vJl4MF80lcI7T3 ZVsGUJkdUqR8SwlRbV18TguaIiRZZ5uirKgl4K04J9qrswTHeerWV3S7qHT52XVI VefZwxZI6v/UtQXN/4QmfkNUpXWdY1b51HEBBUcC0v/ci+r17fB7UK8cn+336utG AJKo4+sc2cbKYU+geilM006Nnzxq7PgWxLIMV5/UGfKlroDqbJrkWXCL/F3YV3rK 2IOY5zYQC45lKlITDlU9YdRhbXX8wHUJ503ggX9F9SUsa9RlWAJqrbPNz3vzhXZT YHN5naLRhigQR9YdFuxGZTLC/f7yq/zCA0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1692633654; x= 1692720054; bh=DGABjcRsCONd9w7Vij9NyVm0mchfuhqQSpqz4PskzzU=; b=u yOPqHd3CRT5wnUzoopn0izKZPZmXavtVd6HU1FIPz+l9AEugrkp2Lo4VYYa1kBiz 4cnWCwJESjtze2GBhBzThtrqXTJuKFT190r7dUfu/CYoK2UEv76QjDFkYN18/qPD QRi2qEJsLDeGqGmQKpv1uNSObJ1E2fjqHYrs6IU3B2fPbXoJw0jr1yiKbUBf627m GP96wUaVuBMMyKk9YxLtc+ct3TP4jSouQseaM/Xlc8NlGaLc408nEzSTLL56vHC7 IegeFdYoWGsKPs47Cdr12t7W7k0FUYstSQ3EKx+Wntnu0Q5DKOPjHKwLMXaLzMkj 0Ok6/yY5x5s8g1cxg4khg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduledgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffudehtddugefgkeevudffheevvefhfeettdfhveei vdfgieeghfeiueeggffggeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Aug 2023 12:00:53 -0400 (EDT) Message-ID: Date: Mon, 21 Aug 2023 09:00:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset? Content-Language: en-US To: Rihad , pgsql-general General References: <69eacc0a-7e9b-4a35-278b-110b93d72882@mail.ru> <18167fbd-815f-9b43-7016-5e5bbb8fb255@gmail.com> <9440ab9c-4ee1-7668-5476-dc28e8086524@aklaver.com> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/20/23 22:31, Rihad wrote: > On 8/21/23 00:15, Adrian Klaver wrote: >> On 8/20/23 12:10, Rihad wrote: >>> On 8/20/23 20:22, Adrian Klaver wrote: >>>> On 8/18/23 22:35, Rihad wrote: >>>>> On 8/17/23 13:01, rihad wrote: >>>>>> >> >> Hard to say without seeing the actual settings in postgresql.conf that >> match: >> >> https://www.postgresql.org/docs/current/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-SCALE-FACTOR >> >> >> Most importantly: >> >> autovacuum >> >> and >> >> track_counts >> >> https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-COUNTS >> > > They are both on and set as per default. Autovac/analyze continue > running on some tables after pg_stat_reset. Just not on all of them, > even thought they should judging by live/dead tuples calculation. > > > foo=> show track_counts; > track_counts > -------------- > on > (1 row) > > foo=> show autovacuum; > autovacuum > ------------ > on > (1 row) How about the rest of the settings at?: https://www.postgresql.org/docs/current/runtime-config-autovacuum.html Have the storage parameters for the tables been changed per?: https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS In psql you can do: \d+ The setting if changed will show up as Options: Also are there include directives in use per?: https://www.postgresql.org/docs/current/config-setting.html#CONFIG-INCLUDES You can see by looking at the sourcefile field in pg_settings: https://www.postgresql.org/docs/current/view-pg-settings.html > > >>> >>> >>>> >>>>> >>>>> There are still many tables waiting for their turn, which is long due. >>>>> >>>>> Although there are some tables having only 60-70 (not 60-70K) >>>>> n_live_tup that have had autovacuum run on them. Weird. >>>>> >>>>> >>>>> >>>> >>>> >>> >> > -- Adrian Klaver adrian.klaver@aklaver.com