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 1uHQpl-002Ftg-7m for pgsql-hackers@arkaria.postgresql.org; Tue, 20 May 2025 17:32:57 +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 1uHQpj-007qY0-Rg for pgsql-hackers@arkaria.postgresql.org; Tue, 20 May 2025 17:32:55 +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 1uHQpj-007qXr-Hp for pgsql-hackers@lists.postgresql.org; Tue, 20 May 2025 17:32:55 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uHQpg-002z2B-2n for pgsql-hackers@lists.postgresql.org; Tue, 20 May 2025 17:32:55 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-54b10594812so6882627e87.1 for ; Tue, 20 May 2025 10:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747762372; x=1748367172; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ULWE4HVsFlPp6Z8srO80bC4Zru7WrWryTcG2E/SMLHU=; b=ibeR3NVJNg4uHmR2B876fQ0rHocqhFmw8B8I2yIoZLknk6wG7kH/OjoJA7+/y/UHXt 1V1y642Nn8dO+GWpuwlRBbEHhrd8wqzUq2tcUeDsGBo6BpRVy3Agado/XUmKQ72kcxOU GhwWlyJA4u+LwbM7GmdmFfcX9g3Te63cGoOlDo8C3UNi4dWK/fdmz0BK84T0vcBQgxbD 7e3AiEGdwyVrOZy73OQCFOW9Om6gwjnye0CwFgOt9QKmrglaypyPNJGDXQKPdv/DlSA+ 8Rmt5s5QODKmZoy4NU17odu5bfm0fjqBq55xBfwp1ly0smzDOdCPRymFF/IRRsdJU97S TcRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747762372; x=1748367172; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ULWE4HVsFlPp6Z8srO80bC4Zru7WrWryTcG2E/SMLHU=; b=JALz3I4sllEAyT+ofFuy0SNpL6iJ4gGz5qGcHUX6+iZbQaK16+kWUm95LbhjiNJmaA VWU2I9anG6IRpPFzE5qNQMIR+DvrvxX8j18bD5E89NEyiZdlJ4cjnjWJ2zyCAlN7YMPz SSwEWrG7wnG57t/MSAuLyN+2tXNd4grZjIlepCJKfP02ILyPzFvthxdKeD8MvQBpUtKc LRdKHxUf6h9kI8/yGBCMVDoSOEv0BwA8w03hLks7QWO88raupvp1Pb5Qmpv3kTtkxA/D j7ZyBY63OZq611nbr+PO/+qtlLtT1f754UWHqwM8NnFAn5BdrfUAVy+Kfc9jRlKvDhtk d9Kw== X-Forwarded-Encrypted: i=1; AJvYcCU7V4GY8MMzlzT2vmx78qSLscCYlgfOtK550IABw3BC4wMG/44r1cd0ySgbcnjLK6fwfkZnBbWy7Gt1x0Hp@lists.postgresql.org X-Gm-Message-State: AOJu0YwWVR8pSQIokC20Ds5mcshlBNU+lcMLKSVIBL6QTsvwR7R/ZjSa 0G2IQJxOmTfx6lYcnfFm82beXD//Y57saYdqRk1cLHDOhanzQqzaLVVYYjtgPCBVbLr7lVOdVZ+ 0zOsh0sPmC0+Vz2tf/nFlBkgc+5bAbbc= X-Gm-Gg: ASbGncs4FK0KdoAbMZkUH4LnfJ9317z86InY+H8D58GDfClj9QYoOxTuonU1zl/NL5x +zfmz+F+jzxfrz8EvpmlWh3ehlshXLUh99xkIreau7LShJO8Oj5jyD490hhJsNvNmUBHWq2IW/m AiqeozvASvaZOG+XAVaVqkiYjK5Y2bGYML X-Google-Smtp-Source: AGHT+IH2VSWcvEbi0yUB2LLEobIbZMicAvtHzNgvPWI4cCLx8KfGTw0jtiLe96ytkmtKXmTqNycptis0rrh6fyayjg4= X-Received: by 2002:a05:651c:421b:b0:306:10d6:28b0 with SMTP id 38308e7fff4ca-328076e8934mr53116951fa.1.1747762371632; Tue, 20 May 2025 10:32:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Hari Krishna Sunder Date: Tue, 20 May 2025 10:32:39 -0700 X-Gm-Features: AX0GCFuFHzjPwBzJ0JaKdx-yVpvOegkNTNKeobNBSqeLbVMon2eEEZgxhlUmS9Y Message-ID: Subject: Re: Statistics Import and Export To: Nathan Bossart Cc: Corey Huinker , Jeff Davis , Robert Treat , Robert Haas , Andres Freund , Tom Lane , Michael Paquier , jian he , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Content-Type: multipart/alternative; boundary="000000000000502145063594a32a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000502145063594a32a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah ya, forgot that reltuples are not always accurate. This sounds reasonable to me. On Mon, May 19, 2025 at 2:32=E2=80=AFPM Nathan Bossart wrote: > On Mon, May 19, 2025 at 02:13:45PM -0700, Hari Krishna Sunder wrote: > > I think it would be better to revert 9879105 since there can be a > > considerable number of true empty tables that we don=C2=B4t need to pro= cess. > > I'm not sure that's a use-case we really need to optimize. Even with > 100,000 empty tables, "vacuumdb --analyze-only --missing-stats-only --job= s > 64" completes in ~5.5 seconds on my laptop. Plus, even if reltuples is 0= , > there might actually be rows in the table, in which case analyzing it wil= l > produce rows in pg_statistic. > > -- > nathan > --000000000000502145063594a32a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah ya, forgot that reltuples=C2=A0are not always accurate.= This sounds reasonable to me.=C2=A0

On Mon, May 19, 2= 025 at 2:32=E2=80=AFPM Nathan Bossart <nathandbossart@gmail.com> wrote:
On Mon, May 19, 2025 at 02:13:45PM -0700= , Hari Krishna Sunder wrote:
> I think it would be better to revert 9879105 since there can be a
> considerable number of true empty tables that we don=C2=B4t need to pr= ocess.

I'm not sure that's a use-case we really need to optimize.=C2=A0 Ev= en with
100,000 empty tables, "vacuumdb --analyze-only --missing-stats-only --= jobs
64" completes in ~5.5 seconds on my laptop.=C2=A0 Plus, even if reltup= les is 0,
there might actually be rows in the table, in which case analyzing it will<= br> produce rows in pg_statistic.

--
nathan
--000000000000502145063594a32a--