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.96) (envelope-from ) id 1vkhtl-001AN2-1Q for pgsql-admin@arkaria.postgresql.org; Tue, 27 Jan 2026 12:10:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkhtk-00DdNL-1n for pgsql-admin@arkaria.postgresql.org; Tue, 27 Jan 2026 12:10:20 +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.96) (envelope-from ) id 1vkhtk-00DdND-0G for pgsql-admin@lists.postgresql.org; Tue, 27 Jan 2026 12:10:20 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vkhth-002YpQ-3B for pgsql-admin@lists.postgresql.org; Tue, 27 Jan 2026 12:10:19 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-790992528f6so53804087b3.1 for ; Tue, 27 Jan 2026 04:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769515818; cv=none; d=google.com; s=arc-20240605; b=R3Fi4V6mZwjhGGRqo9/QrGogO49d4BL/k0I5wDdxxV1j7d60ZTo+ATYOD0cOTEb/8D QTqGoFHrB+a+l7R+v1tv+QDXZD76vst7v8jRvNvFZWFK9jfxUAEOEYt85lkAYGr6Z2Z5 J108wGdYgKCIPbrsZmIszeTpULlRWZ6LWk6UYMBUoadntCP0QCm42LsX2A1LSKHTaBjy HwhrBtwg2hrdChaQnIpI3BbSpfPOm38BiW61YJI16SwJz2/sWU1vqyxNN46QQUXCwRv+ cuigFFSGzT2DPv/qeBwZM3VIz/KYNo9jfJvTGa4Lz1h5KRqzUwhI5ez2e8mbi4d9qYc/ 5eVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=G5cw5OPA7rC8zs97dE97kWyfk4AV3urf+oZjW1yoLdU=; fh=druxZHa2fk4e6MLibibygn9AWWgeaAPo4m8Gpo2MBXU=; b=VXmsAim79Xo78tWuAohJe/quDBnuE1L50I+EWftxJ/xpKEx6dM2+65PZhcqYIU+XPN iSr+dIF4nKTzVKpIc3qxAxhXeIVqIZSUc22sR+4YscoNz7TOgckNprw7ufPKPwAl1RKv /nZFMYfsz2RR1hsqe2HEWeegsckyOwvv1Bv3QdS1Ni9NBvC/D8tU7/kGEgBUrYeDtD8a PWghOy0w1Z+3zCJVYeNKKVDXiq88Esw0AQoruLS3eENfalbwL19Wk4NFVbCGlKPK2uN6 YTyxJSii1eI7d70SHEwKrc7Ockcw5j9GeiiqzoIpY/ZDWkO6oAzdomAxcsNffrljrPC1 nWCQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769515818; x=1770120618; darn=lists.postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G5cw5OPA7rC8zs97dE97kWyfk4AV3urf+oZjW1yoLdU=; b=BfJOM84HLZtPQb8ESoNp1VQO5LWowpk2ddLCaQ5j0yw5fuX/UTK4YoZDdslhZ1XbBm EptXbLxT8MJeplcOwMljIlmxG+haoPoV6T05gScSjhAoItRwzKU6vRF+jCg0VwVO3R+I 4SjqNsHYDnunbOcV7rvpvkPgYHvfA6QRL7cCAPKV7hGOGBlpRJLbyCbDeupEs6zr9azo GUGMMi8keTZq9dOxzopyUxfLBp3rEVhwzECb1M8G5kTcAFkTOkSf6WQKe42ydb0+Lu1G ud0aGqyaaSwT3HPmkT+Kcxn7g9MMl18/6z+8cSGi29KpBLXPIlbAVnVac93c+XwBJaRT veuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769515818; x=1770120618; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=G5cw5OPA7rC8zs97dE97kWyfk4AV3urf+oZjW1yoLdU=; b=rSiFJev1hONRIMjbaA43uaMbzvVuQJgwNAMp1k0ugHhf7iL2WRFsgV65ezK8MUwCNM wC8jZyxfNWgOvEzCKRPp2G4M9r8yAnJyMQV7bmUaCQYwDzmeCjyWs0LQE6TV/9LlMAV0 lWRYLFM+L8WukUm2lKAm5IkGAptLVa4/+U2FF3vbxAKZc4HASqcxmkUCCSngSQnYH6mC oX264117Q/2I86dINPf2w4icNVre+QDcpDCFC/vilhvY0kE+aFOTRhYQG2UexC5CuQX1 cF0JhzxyhcDxSWwG+RbqEulfzA2q8bP6127ae1akqd2rNfC9w8YogAmZWQWecCo60672 XFKA== X-Gm-Message-State: AOJu0YyWN1r8LLelHDE9T0Ns65aqJADNFe5o+Hs9hfXKNVDXNrRtwzMj DshKHOUoZ+BZfcC0A5AWMTihHK+7c8EUlbz4ajJ0bq1w114pR5i/cmsR3EYDvyjgF7Iw5Tb/Cd3 PKLPPHQV3s6kqGSJhczoKwhxPxeQgOf+mBdrlFt2O+w== X-Gm-Gg: AZuq6aJfDpDCCZR2DixT0VVSpriKB6uQIlvOjF/NKt8tYqWF5lCwh/i2YZjIKfmWg/n usrxv2vkQTpV5Lw7quBg2A6Uu48OZlNy9AqTbCRtCItLabMwELVJtHuP4H/Pj6801ewl4I8MhYb apgBMcv93dP/CMh1N0GBlqtLMQZLlxc/S66HrhE0du5kfKvEqiMxLj45HmDdKBgL9Vf5fHB1C7F JUocxpNUyCMVB13EOzuN93p5r2DhVJWQW0Mc0yvmSB2CsuLObtbfQBcHAmiQh/zt+PH48Axjs5b wtFp1UkLSITg3OUQXtnDxA+7DVGeZlLAymT8kAFBTbbfEEJv5qnMFQ== X-Received: by 2002:a05:690c:c512:b0:784:8994:297c with SMTP id 00721157ae682-7947ab2ec4bmr12290787b3.24.1769515817846; Tue, 27 Jan 2026 04:10:17 -0800 (PST) MIME-Version: 1.0 References: <0dce35ca-24fa-4234-99fe-071bd5725a32@ya.ru> <04dc073cd84313cb9b711833f905a07d099a5f28.camel@cybertec.at> <99731769513229@mail.yandex.ru> In-Reply-To: <99731769513229@mail.yandex.ru> From: Kristjan Mustkivi Date: Tue, 27 Jan 2026 14:10:07 +0200 X-Gm-Features: AZwV_QhQk5jDAANTBPzsSd9W8QNa1IFvrZCvO8toL-BeRFTm2M2d5uT4WOumkaQ Message-ID: Subject: Re: autoanalyze did not run To: Pgsql-admin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 27, 2026 at 1:40=E2=80=AFPM =D0=9E=D0=BB=D0=B5=D0=B3 =D0=A1=D0= =B0=D0=BC=D0=BE=D0=B9=D0=BB=D0=BE=D0=B2 wrote: > ---------------- > =D0=9A=D0=BE=D0=BC=D1=83: =D0=9E=D0=BB=D0=B5=D0=B3 =D0=A1=D0=B0=D0=BC=D0= =BE=D0=B9=D0=BB=D0=BE=D0=B2 (splarv@ya.ru), Pgsql-admin (pgsql-admin@lists.= postgresql.org); > =D0=A2=D0=B5=D0=BC=D0=B0: autoanalyze did not run; > 26.01.2026, 19:03, "Laurenz Albe" : > > On Mon, 2026-01-26 at 17:35 +0300, =D0=9E=D0=BB=D0=B5=D0=B3 =D0=A1=D0=B0= =D0=BC=D0=BE=D0=B9=D0=BB=D0=BE=D0=B2 wrote: > > > > I try to investigate why autoanalyze did not run in time of our init= ial > > > loading data. Yes, I know, running analyze manually is highly > > > recommended in such case. But is must run automatically too. > > > > > > PostgreSQL 17.7 (Debian 17.7-3.pgdg13+1) on x86_64-pc-linux-gnu, > > > compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit (from PGDG) > > > > Are you sure that you committed the transaction? > > I am very sure, thats why there are 13844347 rows in that table. By sing= le copy. > > > > Is "track_activities" set to "on"? > > I checked, yep. > > > Then the only explanation is that all autovacuum workers are active, and = this > table is starved. See how many autovacuum workers are visible in pg_stat_= activity > and compare that to autovacuum_max_workers. > > Yours, > Laurenz Albe > > Now 0. But they worked. The reason is other. Look, first of all, there wa= s not a statistic reset. > SELECT stats_reset is null FROM pg_stat_database WHERE datname =3D curren= t_database(); > ?column?\c > ---------- > t > (1 row) > select analyze_count,autoanalyze_count,reltuples, n_live_tup, n_tup_ins,= n_tup_upd, n_mod_since_analyze from pg_stat_user_tables as s join pg_class= as c on (s.relid=3Dc.oid) where relkind=3D'r' and reltuples>0 limit 10; > analyze_count | autoanalyze_count | reltuples | n_live_tup | n_tup_i= ns | n_tup_upd | n_mod_since_analyze > ---------------+-------------------+---------------+------------+--------= ---+-----------+--------------------- > 0 | 0 | 8 | 0 | = 0 | 0 | 0 > 0 | 0 | 76596 | 0 | = 0 | 0 | 0 > 0 | 0 | 140997 | 0 | = 0 | 0 | 0 > 0 | 0 | 2.088436e+07 | 0 | = 0 | 0 | 0 > 0 | 0 | 1.2661012e+07 | 0 | = 0 | 0 | 0 > 0 | 0 | 2.288401e+07 | 0 | = 0 | 0 | 0 > 0 | 0 | 99926 | 0 | = 0 | 0 | 0 > 0 | 0 | 1.5620866e+07 | 0 | = 0 | 0 | 0 > 0 | 0 | 17511 | 0 | = 0 | 0 | 0 > 0 | 0 | 400926 | 0 | = 0 | 0 | 0 > The reason is the n_mod_since_analyze is 0. Thats why autoanalyze didn't = started. Hello, I do apologize if I mix something up now, but I would expect COPY to have an effect on "n_ins_since_vacuum" but not "n_mod_since_analyze". COPY inserts rows, it does not update them. With best regards, --=20 Kristjan Mustkivi Email: kristjan.mustkivi@gmail.com