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 1vRDRf-009jed-0g for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 17:48:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRDRe-003qQB-0M for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 17:48:46 +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.96) (envelope-from ) id 1vRDRd-003qQ3-2H for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 17:48:46 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vRDRb-0038oC-2E for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 17:48:45 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-b7355f6ef12so217394266b.3 for ; Thu, 04 Dec 2025 09:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=f10-com-br.20230601.gappssmtp.com; s=20230601; t=1764870521; x=1765475321; 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=wAVrTwHXQy52NXsn2jSgmdCkVkYjBqxGC8nha0dHvTk=; b=iDd3X1nKkHYsRs6macsTdy/gkb+quRw9vj/GK5jIfDx1Qdfm9vAweerxiMVU33GIJ8 /aWfE96NwIDwD2/i0dZjpWfsbr7ufN4sTwTcU6cvMamwYnQhaFtFG10z+eC+DiwuBSs8 KYFVRff1VV9D6FEaZ6kQ6SVcfErVP72i9psEMuChp166vASXepgPBhnfHY73SlGOTyT3 1Pxt6BpWEIWAocSfCxNzacCBjZ/rcpcB8ajPPgVlClKxsuFvEJU8y1oMFeNRlx2E4Fmi lALYlqW5oQMgVQ9I8jDjhsBtWCNoGgRHgz3kmb7xwENuIuWq5lh26v+w8YmZlw0w+Ibt q5yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764870521; x=1765475321; h=cc: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=wAVrTwHXQy52NXsn2jSgmdCkVkYjBqxGC8nha0dHvTk=; b=LFCrEHcFoiTZ7BDh/tSqNJjfT9rMySRJxunFi5iAnIb5pQtO/p6F+ISf8w/AXr2CAA zGvrdXiflPMR6EqgcFL0yHSPqfk0NH/biAlHJWqdp7Sib6qUoWPdjVN7gqpK5UqEQ4RJ UBajuVzqLr9irr67rgX9rA4uxomHsqgkC5u7bQDDqxbgex26JyDhy50h5ZdG2+aiWfAi LF9JH993S9meu575Hz5O6ntJYRHf6/AC5F74rc5yfepWMqeZkLxFdmNZkos4rKII7e1H r+2t1L8Z/PBzIDRtz+RgseS0zlo/PYyK5L+Pxvn/vgnqLLRcDKg23bZOQvbugGwtooKf SfIA== X-Forwarded-Encrypted: i=1; AJvYcCWAZkOZuOfW0hGDp3U8KMA8uFpRvS6XOfE1ZVSpNdk3zUqkUFdHkuXVVZs6h98cWRlZzRYfUtsfLPkdFY9u@lists.postgresql.org X-Gm-Message-State: AOJu0YxAsBGXxhOuyA7UOjlpmq4LeTUMHMZJzEKUfGebvq5sD5WJzsjX BsZXr+F7Alueah64LMOMjlAXKc70Oi2TAzqpwW62vnZBupq+z2aWRsgOM15ZdqBYlH+BTZN87vK sv1ZIskDBmQw9rQgEsqoZkt2Di2ZO/+WhNmqRT5uY X-Gm-Gg: ASbGncsHqwuc5Et76tegqVdW9SUUMDNtMS8IwElMFUwAVNifvAOEiRwceIBXCFdEIcH Z3fpHPFdWqCgKnsuZ3xhL+vkCBeGZ8Qck5hf6Gn3FvXZYu90Jcfv6sBJ2Z4UZ8iMGSGv32xoPeA X8Eks8CoR9Nm6YMRmuImvuBB6xwnKyviDABrzaoozT5+JlSVqmamaI/6lV2TiziLDJfcjm2QGJj WbDtWUObYrwNSnYJ1+8eCAE9hChuHCa/LKvEn+q80Mlpyype3edZxw2VWUPC7lYyjSVMoE= X-Google-Smtp-Source: AGHT+IGCG8IxMrjjQWIs+ywqn6V05gAsEdAoblyY3OJIeN0MqlnsX9XQe+MNMr91AuaXK303eAdp5s5yM47TVkuKgrs= X-Received: by 2002:a17:907:7f16:b0:b76:e6bd:7bcd with SMTP id a640c23a62f3a-b79dbea9760mr723658266b.20.1764870520705; Thu, 04 Dec 2025 09:48:40 -0800 (PST) MIME-Version: 1.0 References: <84a6d065-1dc3-4b37-af7b-75904d967ab4@atlas.cz> <202512041531.4yz4szwnfsqk@alvherre.pgsql> In-Reply-To: <202512041531.4yz4szwnfsqk@alvherre.pgsql> From: Marcos Pegoraro Date: Thu, 4 Dec 2025 14:47:56 -0300 X-Gm-Features: AWmQ_blBsMkWDbdcznX5UYLEjbVfDQ7oSA5YEx4i6Hx6HcNjQTRDs5reG2E88eY Message-ID: Subject: Re: Adding REPACK [concurrently] To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: David Klika , ah@cybertec.at, jian.universality@gmail.com, pgsql-hackers@lists.postgresql.org, mihailnikalayeu@gmail.com, rob@xzilla.net Content-Type: multipart/alternative; boundary="00000000000076219f064523f067" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000076219f064523f067 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Em qui., 4 de dez. de 2025 =C3=A0s 12:43, =C3=81lvaro Herrera escreveu: > If you only have a small number of pages that have this problem, then > you don't actually need to do anything -- the pages will be marked free > by regular vacuuming, and future inserts or updates can make use of > those pages. It's not a problem to have a small number of pages in > empty state for some time. > > So if you're trying to do this, the number of problematic pages must be > large. Not necessarily. I have some tables where I like to use CLUSTER every 2 or 3 months, to reorganize the data based on an index and consequently load fewer pages with each call. These tables don't have more than 2 or 3% of dead records, but they are quite disorganized from the point of view of that index, since the inserted and updated records don't follow the order I determined. regards Marcos --00000000000076219f064523f067 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Em qui., 4 de dez. de 2025 =C3=A0s 1= 2:43, =C3=81lvaro Herrera <al= vherre@alvh.no-ip.org> escreveu:
= If you only have a small number of pages that have this problem, then
you don't actually need to do anything -- the pages will be marked free=
by regular vacuuming, and future inserts or updates can make use of
those pages.=C2=A0 It's not a problem to have a small number of pages i= n
empty state for some time.

So if you're trying to do this, the number of problematic pages must be=
large.

Not necessarily. I have= some tables where I like to use CLUSTER=C2=A0
every= 2 or 3 months, to reorganize the data based on an index=C2=A0
and consequently load fewer pages with each call. These tables= =C2=A0
don't have more than 2 or 3% of dead reco= rds, but they are quite=C2=A0
disorganized from the = point of view of that index, since the=C2=A0
inserte= d and updated records don't follow the order I determined.


regards<= /div>
Marcos
--00000000000076219f064523f067--