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 1sdZG5-00Gj0N-H3 for pgsql-admin@arkaria.postgresql.org; Mon, 12 Aug 2024 17:55:05 +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 1sdZG2-00Gy76-FB for pgsql-admin@arkaria.postgresql.org; Mon, 12 Aug 2024 17:55:02 +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 1sdZG2-00Gy6x-0a for pgsql-admin@lists.postgresql.org; Mon, 12 Aug 2024 17:55:02 +0000 Received: from qs51p00im-qukt01080302.me.com ([17.57.155.21]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdZFz-004VGP-Em for pgsql-admin@lists.postgresql.org; Mon, 12 Aug 2024 17:55:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1723485297; bh=0u+CB9ALWY31YoxZRDb7515TfMC3EaBLOdkIGSD3yN0=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; b=DXenqJw3760IZKxxPcqXmz4olxUJoRTDCEZ7kiog9i/XgvFbF4vrxrkV9KwzcbbuD 1TjYo2L5+UmK0nHFz1xh7KFoCgX+WM+t5V1tJCLm1Rw4YzpeY4E7436AZkC0u7dh14 XgPab6Yxu0ITn3P9CqvG1Y2KS4hjz2RWHn2L4aNDD4bm6ZThr8Bx4bgWAb3KeH3KRD 75wwx4sfwzvUPpK85o3h7FHBd79I8qI7r7ciMqFxCLo/Uvrum4nFlrf82lAlVG9Mss zDb1JPbfJEYF176MW1Tq73GSGXrK6FREZrJHXb8pNRrFYzDSVE7BXDCcyrhn2Q+VUd Vnts9y+HMMr+Q== Received: from smtpclient.apple (qs51p00im-dlb-asmtp-mailmevip.me.com [17.57.155.28]) by qs51p00im-qukt01080302.me.com (Postfix) with ESMTPSA id 94E84114014B; Mon, 12 Aug 2024 17:54:55 +0000 (UTC) From: Rui DeSousa Message-Id: <2A5A54F1-9954-40B5-8E87-5F8BA6C8D6C6@icloud.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_41CB3D64-BB83-4CF2-9EBF-24C485662260" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: Pg_repack Date: Mon, 12 Aug 2024 13:54:50 -0400 In-Reply-To: Cc: Pgsql-admin To: Ron Johnson References: <202408121548.x5qz5npcikiw@alvherre.pgsql> X-Mailer: Apple Mail (2.3696.120.41.1.10) X-Proofpoint-ORIG-GUID: kmVWEsReDMPVME7tiYmiHmUaPY5eLSoJ X-Proofpoint-GUID: kmVWEsReDMPVME7tiYmiHmUaPY5eLSoJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-12_11,2024-08-12_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 clxscore=1015 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=810 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2408120133 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_41CB3D64-BB83-4CF2-9EBF-24C485662260 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 12, 2024, at 12:06 PM, Ron Johnson = wrote: >=20 > But pg_repack is just a better VACUUM FULL, and VACUUM FULL has to be = better than autovacuum because it fully vacuums a table. >=20 No. Vacuum =E2=80=94 actually vacuums by removing dead tuples that are no = longer needed, freezing tuples, etc. The removal of dead tuples frees = space on the given page and it also truncates the fully empty pages that = are located at the end of the file if it can. Vacuum FULL =E2=80=94 is something completely different. It rebuilds = the entire table thus it coalesces all free space and by proxy does the = same as vacuum (removing dead tuples that are no longer needed). =E2=80=94 It does this by creating a new table and then swapping = in the new table when; regardless of the number of dead tuples. Vacuum FULL should not be run on a regular basis. --Apple-Mail=_41CB3D64-BB83-4CF2-9EBF-24C485662260 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Aug 12, 2024, at 12:06 PM, Ron Johnson <ronljohnsonjr@gmail.com> wrote:

But pg_repack is just a better VACUUM = FULL, and VACUUM FULL has to be better than autovacuum because it fully vacuums a table.


No.

Vacuum =E2=80=94 actually vacuums by = removing dead tuples that are no longer needed, freezing tuples, etc. = The removal of dead tuples frees space on the given page and it also = truncates the fully empty pages that are located at the end of the file = if it can.

Vacuum FULL =E2=80=94 is something completely different. =  It rebuilds the entire table thus it coalesces all free space and = by proxy does the same as vacuum (removing dead tuples that are no = longer needed).
=E2=80=94 It does this by = creating a new table and then swapping in the new table when; regardless = of the number of dead tuples.

Vacuum FULL should not be run on a = regular basis.


= --Apple-Mail=_41CB3D64-BB83-4CF2-9EBF-24C485662260--