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 1uoeGZ-007U8w-J6 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Aug 2025 08:33: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 1uoeGX-006JKL-MQ for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Aug 2025 08:33:54 +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 1uoeGX-006JKD-8k for pgsql-hackers@lists.postgresql.org; Wed, 20 Aug 2025 08:33:53 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uoeGV-000oWP-1B for pgsql-hackers@lists.postgresql.org; Wed, 20 Aug 2025 08:33:52 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-6188b7532f3so11176289a12.2 for ; Wed, 20 Aug 2025 01:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1755678830; x=1756283630; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w/fcjExwQazKWTl7qjKiM4y+8m0QeduJfWehy/BKecI=; b=ixNPDFYAZ7QaZslfNyXNYGMPH3SGsbbmmlj55yP114iYrtDRdMHBj6D0yPzq6j7JrP LQtt0TuQjITkGp6R1pMz+SwtiZLYWqU0Iqso8T04VwmudaYno5N8nZc/qE+N3vhYlurg 6RCSehdNdo/ly/Gam6TbTyH+er6/5wHaSXeClVaWcD2s6fxnONss3GWjQ4OsoAmI9diD 5ohIOgZ4myesZnDdxHwEBz0+be/P+x8nfvOHrV+3D5noOclN9BhjF2SQvzce1853WG3j YR0voQHPaoe+Qd5H27QwGTP/igTGFZEMstr2k/rVtKcqe0psxiMzC3FjWU5PTAipBtE9 x9Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755678830; x=1756283630; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=w/fcjExwQazKWTl7qjKiM4y+8m0QeduJfWehy/BKecI=; b=GfEIXsyrrYghlwXHDYGwsTFV+JD2UME5koiwqyWZvGs4E9a6U5Ni15ZoW8IjGUNIk5 Xq2ng4lG5FT0Qpne9fALPlsk9o6Kus2D4XWa/UB/F0owK55WZ2o5UhJxsmGQ7UWqjGjN eSOY+QGPk81Rr7WOehA8sjg4ML5zWPIR6OmKv36eVKhWMnqy0cFwda+WjFu2wI1q1phc ZOazSb95vGQt2Y/ROdu4WRLOhgT/NZUxyohR3UzU0AHNJ4I72bToAbTkp3rJ21uMwAR3 qCpdF5nrUzKt1Lw1mMKwoFyyOto4uegff38sfzcfkV5E+687xhXcW8rQ3onKFAtuhquU Wv6A== X-Forwarded-Encrypted: i=1; AJvYcCXZ4b7nMktX2mRunjlcyfc5jeaXtgKHIX9CigERHfiWxGb71gT6oXXqTXakjO2OmhfCZtft1Qsb9f81Znco@lists.postgresql.org X-Gm-Message-State: AOJu0YwDTh/xtCRmkSRFU8tLQ6dP4IoBCKuiC+KjYspKHE/NJmPPPZMX OscCC8fP+5hi+rzXQ0DrAHnDEQKqFGVJkOiRvxq7tvoYolF5xnbix1yU08PYjrB5RDjnuukDNte 22WYi X-Gm-Gg: ASbGncs4gc/iWt5XAVnWHRCP20TKgt6Z775EEIAIRf3GH3/99ncti2bgSwy6uHnJ1SS HFMA2Xllahfp4+vmci0LOJuFcsEvVk9DsD9kU5XV1qw6KPUJIgNwGTe8p4l5eQyaEtPNPSMxFqe KWOkJu5OqtTVa0Xpi93lf1CII55Ek1j1pfvXBeNnVygizTU8O392jbK4Jftw45AmKod/J6IraC6 LtmhBXnAHCg30AWbjZln/T4EEEA9xea3qy40GRNZe7uiR5XFh/HHdsqFsix/X1r/zcs30d4VQoG b4I+3ex/8U+8ly0FBIYnCsi/ZZ457gaPOrx/DCXkNh0FPoaeChGnM6YDTm3qGBrWFzVzzeJmah4 fja6szc6dLOaT4sSK2bn86zspRmq6+AvDNjSnc05GJscwAik= X-Google-Smtp-Source: AGHT+IGApEqNRUj+0b08JIERPJqNeJA3TGaA3iMRl9tXPuhbwk03XDQUY3D4GiE6ymqRmG95HCOvyw== X-Received: by 2002:a05:6402:2756:b0:615:957f:416b with SMTP id 4fb4d7f45d1cf-61a9752b616mr1986603a12.6.1755678830290; Wed, 20 Aug 2025 01:33:50 -0700 (PDT) Received: from localhost (109-81-168-144.rct.o2.cz. [109.81.168.144]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-61a755d9ce4sm3161749a12.6.2025.08.20.01.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Aug 2025 01:33:49 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera cc: Robert Treat , Pg Hackers Subject: Re: Adding REPACK [concurrently] In-reply-to: <202508191222.ghumvyzw4cmj@alvherre.pgsql> References: <202508191222.ghumvyzw4cmj@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 19 Aug 2025 14:22:47 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Aug 2025 10:33:49 +0200 Message-ID: <18831.1755678829@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera wrote: > On 2025-Aug-16, Robert Treat wrote: >=20 > > On Tue, Aug 5, 2025 at 4:59=E2=80=AFAM Antonin Houska = wrote: >=20 > > > Now that we want to cover the CLUSTER/VACUUM FULL completely, I've ch= ecked the > > > options of VACUUM FULL. I found two items not supported by REPACK (bu= t also > > > not supported by by CLUSTER): ANALYZE and SKIP_DATABASE_STATS. Maybe = just > > > let's mention that in the user documentation of REPACK? > >=20 > > I would note that both pg_repack and pg_squeeze analyze by default, > > and running "vacuum full analyze" is the recommended behavior, so not > > having analyze included is a step backwards. >=20 > Make sense to add ANALYZE as an option to repack, yeah. >=20 > So if I repack a single table with > REPACK (ANALYZE) table USING INDEX; >=20 > then do you expect that this would first cluster the table under > AccessExclusiveLock, then release the lock to do the analyze step, or > would the analyze be done under the same lock? This is significant for > a query that starts while repack is running, because if we release the > AEL then the query is planned when there are no stats for the table, > which might be bad. >=20 > I think the time to run the analyze step should be considerable shorter > than the time to run the repacking step, so running both together under > the same lock should be okay. AFAICS, VACUUM FULL first releases the AEL, then it analyzes the table. If users did not complain so far, I'd assume that vacuum_rel() (effectively cluster_rel() in the FULL case) does not change the stats that much. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com