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 1ttALk-009LfR-4F for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Mar 2025 19:05:40 +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 1ttALi-00Dyic-MA for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Mar 2025 19:05:38 +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 1ttALi-00DyiT-CH for pgsql-hackers@lists.postgresql.org; Fri, 14 Mar 2025 19:05:38 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ttALe-002spy-12 for pgsql-hackers@lists.postgresql.org; Fri, 14 Mar 2025 19:05:38 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7c54b651310so318510185a.0 for ; Fri, 14 Mar 2025 12:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741979134; x=1742583934; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pyeM3gpFebA3kClP0R9xjVVLMKIpzuRAC7lSIoK2CpA=; b=BmrXRolYbMYLpzos2JnqwGCPYsDap9euwALcQvYUfmkECZtWc31AIGUrY+VTmqPVE8 a3tCwPYeIF27dii8zVGbWqRmUPtjskZp/1Shslarlt11Vzh7GRsbrniPZ5vw/NtKvKmO pp8SZr6ejZ2BfTHSruPkv39q+eqmPnww0gKujTmjyoBrvP9+48lXNACEZ+4SCmbHp17k 9VBsfUAFccMOsM3XbjWByfDc/XYEF9Zl3dMJ4SLwLNEthic/MRRTHtxu8ZOuq7mILXMr PIX8hfakDspLD6+cKDeusKHf2IQl72m5t6XwJXVMy3+8ZKItfxSsrK/ATITXV88drRKe oAug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741979134; x=1742583934; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pyeM3gpFebA3kClP0R9xjVVLMKIpzuRAC7lSIoK2CpA=; b=MaRxJPbtedjeRhh6mJg4lJG5E+qWBXn6emcTrS5XeixyUyK1DnRmO3pSIV7X1bv3i+ FvNCjd1Fu+Ep3krgFwwLFPcKTaauXFygwHl0Tz225RebLgr+aXNW0FkBuIZcRf1Q2adZ L386+seCo9EAzdbUL2iOBae+mdG6c/6xBql6CJqO/y0xJFr2oEuHfV0qTE9Hran+9Kf7 WEHzyHj6zYP4vhyAxkJvPfu0ziUoF4dtQ6cdW6cvp5KzKM7S9VF6V9RAZLfhAeA9JZ0d tNTORAFpHDyvumhoOfJGwup2tiDI9BlSaMV8mvBUy79M2OYhhmFK7nbEpfPavnzdETsa 6gSg== X-Forwarded-Encrypted: i=1; AJvYcCWR84Z3Zg0VtxdDpvalOsLkag3x11/2Imf4RNtNiBV98EJ7BKLMjD4UgSEtc9emrAcRsNZmKhSdLZ1YTLMF@lists.postgresql.org X-Gm-Message-State: AOJu0YyHfshdGqivtN7ANY3ervXVKwiwLekBaCZ0yUPQ4Ew/Ps8MPFn1 NXBszW37LQJHTDWWf6113h2TsJ8ilYP3SwcYzvsoEfa5zmxX2X4A X-Gm-Gg: ASbGncs9SvujR+j/S/tR03BDcrQzzykXDYNfdEQJLk4jGC4x6zeHscZUkHGS10xUIHt Wj6h3fd+uBbvEDqvacu3/gjP3ijPpeoMzxwVIwx5D2DFKadQQZBiCyeZvGCnd6GfGPK8w7vzMLt T3UYZe9G6M9jLEmAOk8Q27BlFpSfoR2/mKQKKdLzYHUrVrjxIR3DqbI2A1dw0Ic/FAF6lX9diHi 1S14CEKFm3c5fvJbYILu0+BxcidI4WlXqIH/x32XeNcYBZii1eM2+szmD1yv+Y3VLOZ00G1P6lw cm9Q7fLYanKyRGuq28uuK8Su0ocEnZIjR8iaeqxvFmVOXX3xByohrCWud3nH4/RNWRBu0r6uT5W xo/yv5+BKgf67JYBTvZkNM8zRXwE3V/nicB4= X-Google-Smtp-Source: AGHT+IF3E2ieI5WOHsVidpI9RkbAI5hQWmnoetGk+Dc4spw2bNmwllh3xHWovzU59hI73hEUvurrmg== X-Received: by 2002:a05:620a:2941:b0:7c5:4b24:468d with SMTP id af79cd13be357-7c57c79b6e3mr372900685a.2.1741979133630; Fri, 14 Mar 2025 12:05:33 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c573d9250asm286340785a.113.2025.03.14.12.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 12:05:33 -0700 (PDT) Date: Fri, 14 Mar 2025 14:05:30 -0500 From: Nathan Bossart To: John Naylor Cc: Masahiko Sawada , Bruce Momjian , Jeff Davis , Corey Huinker , jian he , Matthias van de Meent , Tom Lane , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: vacuumdb changes for stats import/export Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Out of curiosity, I generated many relations with the following command (stolen from [0]): do $$ begin for i in 1..100000 loop execute format('create table t%s (f1 int unique, f2 int unique);', i); execute format('insert into t%s select x, x from generate_series(1,1000) x', i); if i % 100 = 0 then commit; end if; end loop; end $$; And then I ran a database-wide ANALYZE. Without --missing-only, vacuumdb's catalog query took 65 ms. With --missing-only, it took 735 ms. While that's a big jump, this query will only run once for a given vacuumdb, and --missing-only is likely to save a lot of time elsewhere. If no feedback or objections materialize, I'm planning to commit these early next week. [0] https://postgr.es/m/3612876.1689443232%40sss.pgh.pa.us -- nathan