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 1uZWgU-004n1w-IZ for pgsql-general@arkaria.postgresql.org; Wed, 09 Jul 2025 15:26:10 +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 1uZWgS-000TeI-FA for pgsql-general@arkaria.postgresql.org; Wed, 09 Jul 2025 15:26:09 +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 1uZWgS-000TeA-2g for pgsql-general@lists.postgresql.org; Wed, 09 Jul 2025 15:26:08 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uZWgQ-006Q70-2G for pgsql-general@lists.postgresql.org; Wed, 09 Jul 2025 15:26:07 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3b5e6bfb427so38596f8f.2 for ; Wed, 09 Jul 2025 08:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752074764; x=1752679564; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=lO29UhKlLR0VZIWpaaOwoPcT04U5ZZuPqY0W+uU2Ksg=; b=bcpJCGwryp53/FuDxtku7vCTuwDVsNLCyCS3UtRPiZirpHU1H1Ll0CLzBBT+k19H9N tjX6ceEmhqD+T4sUIUQLW3DhMOXEviAMwwxl5yPqotCUPsbaTxWS6wzBkeWwLbM49aZF /p/ut/DkCtnXADyvomRrkONTilJfUWjWxBK6EQm3A1avaCQYPaWAg+ST9lfWssuxq2PQ sELyu4LtpT9SVbGUIfWsFO6ztDUxL99Qvl2df81PXcNYtIDUSQoKWEAoTDk/DG97ucXh 6oK0gj/URbuPJMvS4TdoRmZSzJLG1LRYNpKwb8KWI17x8pwMSGReqg18g1tVHoTkb51s q+gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752074764; x=1752679564; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lO29UhKlLR0VZIWpaaOwoPcT04U5ZZuPqY0W+uU2Ksg=; b=YEQ6uLWb1I53KbiLYVcsA63v3QtzQSsIS9y2PaBjfS0y/R2sUBqYe9se8LLRj3cLAK TwjvtlR+V11/Eow+musv2DOxR50AlkH1Nyhpf4Vr8WOh+nWSLJ511/wdtl8esQanXvjC aTUVqXjImBT4e6V0Yo5FLzPbbHyBTKtS2l7CMpR0xQoOSG4i+H4N0/GaCnjQcdZwROW/ vEdMj0BiLNoYpQDBIJeSRy65sL1JENSmEv48Bl93v21Uqv3V0PI6RydIAsqeCDcge28D 1xt/Gw5Dxcde75oU/rwwdyFqMh8GwlHg+hIu6LryKhVYFPMlN7PJcWNBVMdAvZCUaAhl 7/LA== X-Forwarded-Encrypted: i=1; AJvYcCUeu5d35Md30UXRQgQXIpZxJiflXhUK/fUykGNfEfwT3QMudPTq4YGpNrilvmEhI0DK+azQYJA4L5/jILCJ@lists.postgresql.org X-Gm-Message-State: AOJu0YweGXpwrg2pc6IYwhPVvx3dV4bWlGoBOacWUPLKWKB+nJbCSOTM +E53rgdic2EuhC2tGsNCLXaBKs/shZk0lwGryRGZR6vy22vNadOuGDQqXCOO5Irf5r+5+P0VmMP soyXq X-Gm-Gg: ASbGnctpkFVoiiFMBK8fp4wScZa1PjyvoobX9wJYi6mjW5TJzD9UWS4hIwN6ZvNO2yP jVW6qgAwAoNhL0jOOGaFSu8Ahvut8I2nvuWfiL9rcXKASHNSmFJ8Zhk7Z7WCj5uaQB4jnHX+S+3 aotkqrg8z0NDHYyQLJ4vJdFFM6pAy+exnZdVB0xLKIIITZYK0coc+dU1kUcwvpDKTFpg+nhU1SP 5vwdwyXW/iX/84/uH4qeP5DncZAwX1Sx8WHSpLTtrfVoQTYcvyMo0zjqFRVV/EnoAqlr8ei8r69 TpoFv9aahpjP9OdsRenuy4xoOfiIVloSW53Us1tRxrdBHA1c8HKp9apOtEZiSNSRRtCSS+7E/ed 6TNdGHhYWVk4cPrw= X-Google-Smtp-Source: AGHT+IHBAlZ1dgQe7/b0piGRu9Gv2EidJOt/Qx3IehimNJrsBCN92olO2O9YzneH143qsu/h3gh9HQ== X-Received: by 2002:a05:6000:991:b0:3b5:def6:4e4 with SMTP id ffacd0b85a97d-3b5e78cd1f1mr365071f8f.46.1752074763806; Wed, 09 Jul 2025 08:26:03 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:260:83af:4a24:d22:8093:bb2e]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454d5062119sm31117925e9.18.2025.07.09.08.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jul 2025 08:26:03 -0700 (PDT) Message-ID: <08d943a83590308cbb9be594d80b4e19ca80e08e.camel@cybertec.at> Subject: Re: analyze-in-stages post upgrade questions From: Laurenz Albe To: "Zechman, Derek S" , Adrian Klaver , "pgsql-general@lists.postgresql.org" Date: Wed, 09 Jul 2025 17:26:02 +0200 In-Reply-To: References: <6add2a9a-7cf2-4d1b-8f3e-2e26a7ebe883@aklaver.com> <4d8122febd3007143504e4b6034b4253f7000761.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-07-09 at 11:30 +0000, Zechman, Derek S wrote: > > > There are no entries in pg_stats for the parent table until after I m= anually run an analyze on it =E2=80=93 Example below > > > > You are right.=C2=A0 I looked at the code, and "vacuumdb" does not proc= ess > > partitiond tables, even if --analyze-only is specified.=C2=A0 I find th= at > > surprising, aince the SQL command ANALYZE (without a table name) will > > also collect statistics for partitioned tables. > > > > I think that it would be a good idea to change that behavior. > > In particular, it makes a lot of sense to collect statistics for > > partitioned tables after a "pg_upgrade". > > > > Attached is a patch to make "vacuumdb --analyze-only" consider > > partitioned tables as well. >=20 > Is there a plan to include this patch in future releases/patches of postg= res?=20 I have added the patch to the current commitfest: https://commitfest.postgresql.org/patch/5871/ So far, it has not got any peer review. So yes, I'd like to include the patch, but I cannot make it happen by myself. Essentially, patches get applied if a) they get peer review and b) a committer applies them If you want this to happen, the best thing you could do would be to review the patch and see if it works for you, if it does what you need and so on: https://wiki.postgresql.org/wiki/Reviewing_a_Patch Yours, Laurenz Albe