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 1qY7oD-000qkP-G1 for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 16:31:17 +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 1qY7oC-008SVH-EK for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 16:31:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY7oC-008SV7-24 for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 16:31:15 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qY7o9-000BQC-29 for pgsql-general@postgresql.org; Mon, 21 Aug 2023 16:31:14 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4ff933f9ca8so5257031e87.1 for ; Mon, 21 Aug 2023 09:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692635470; x=1693240270; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jPsSbJKCbAayFcLm9l42dmJdQANCL/+ObAV3FZ7S72Y=; b=I8Nb6xg540QpI/nS/SERJiyhJIuAtye1WI0zHrY3xH8rbiDWDUzfZcbsIJWgG8VOMc 4PKuj2LdYgfT5Q+VCgtrmL/Rvq2M7gboFg21spJOZsMzRfFS67YJacgOgCOMCxlJsc/d rLSINdDlXzlEhhkbddJithY1OS8DpSCVN/2k1QovU8ZtkVw6TJHQgAfcFzAn6cfdi5H6 iM3h6x6CKxG0bkTD/ZABdp0ctsqF0IN7CVgD8G0Xrr3Au+KKDayeGITRxoKabICC2N4I l4XjjB/jN6r1V9LM3Uip5tis1Ulm1d5xXgRd8dTGZo3qXM4Sm77X1d+lsQtxt202P4Fn QhXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692635470; x=1693240270; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jPsSbJKCbAayFcLm9l42dmJdQANCL/+ObAV3FZ7S72Y=; b=QHctOf8zjLYJv7f/YCf33AfY5WEA1zQSgmfxyhk2yghEP34Q+vezruRu75HzPJF+LF G/eMD+X6ni6eIbzxfF/HE3O9fgSoJ7mXHGP+nHkbchqwninfIpseeo1EY0E+hrMZDIwU XTwRo7tEnvivugcvUUPXwT3OtV2/tmieHF0Ez5/qstRZHBbZjXqCnIB5A0RLLv0lOF0F qrUVAibc5y0pXvL4XRIlZORP+Yp8M/4Aag5xk/ALKdTzgcqK5P6S1roN/IxIpEljdEZn +8e5k6sFjOZUjHBYuQ8guU25hH3tyYmBr7EhxDOLVLkXqnwLfdgRjkQgAyAfoJwb/0XD /GWw== X-Gm-Message-State: AOJu0YxdLAfXoKVC9mLHDVHiwE6c0646jf22mYO1ZUlFxs5gLvqgd6Tx yJPmDeV1u6cxdVL3uG2uWzQ= X-Google-Smtp-Source: AGHT+IHqN1Lp2q5Qjv7O9Zvw7F2sU8mnBLIkExaB6NaGsxuDI8o9FyFOIHhqV2PPbi6bdcDDXFFKTw== X-Received: by 2002:a19:e044:0:b0:4fb:7447:e71a with SMTP id g4-20020a19e044000000b004fb7447e71amr4138413lfj.63.1692635470272; Mon, 21 Aug 2023 09:31:10 -0700 (PDT) Received: from [192.168.0.254] ([5.134.59.114]) by smtp.gmail.com with ESMTPSA id c23-20020a197617000000b004fe83d228e4sm1826153lff.71.2023.08.21.09.31.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Aug 2023 09:31:09 -0700 (PDT) Message-ID: <329abf6c-2165-f410-717f-c20b3dd0a3d7@gmail.com> Date: Mon, 21 Aug 2023 20:31:08 +0400 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: Adrian Klaver , 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> <918f94be-41b9-e684-7679-b6bd819f693c@gmail.com> <9fed2b70-cc36-1239-d5b6-7a81afeafb82@aklaver.com> From: Rihad In-Reply-To: <9fed2b70-cc36-1239-d5b6-7a81afeafb82@aklaver.com> 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/21/23 20:17, Adrian Klaver wrote: > On 8/21/23 09:09, Rihad wrote: >> On 8/21/23 20:00, Adrian Klaver wrote: > > >> Thanks for the detailed reply, no tables have custom settings. >> >> I need to make it clear once again that all autovac/analyze work as >> expected when n_live_tup matches reality, i.e. when analyze has been >> run on them since last reset. >> >> A way to fix this is to simply analyze the whole database. Before >> doing that, while n_live_tup starts from basically 0 and grows based >> on DB activity, these usual calculations of 10-20% table size for >> vacuum/analyze don't work. They don't trigger autovac for most >> tables, or do it much much later. >> > > You still have not said or shown whether the other autovacuum settings > are the default values or not. Assuming they are, then the only other > explanation I can come up with is that there is a process or processes > that are creating long running open transactions that prevent > autovacuum from running on the affected tables. > Sorry, they are all as per default, commented out in the config. There are no long running queries, otherwise they wouldn't be vacuumed/analyzed in due time after running first manual analyze, which updates n_live_tup to match reltuples.