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 1ryfw7-00HTEK-Us for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2024 22:45:27 +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 1ryfw4-00GQu4-BZ for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2024 22:45:24 +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 1ryfw4-00GQts-0a for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2024 22:45:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryfvx-002Eq8-Al for pgsql-general@postgresql.org; Sun, 21 Apr 2024 22:45:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 43LMjExP2870092; Sun, 21 Apr 2024 18:45:14 -0400 From: Tom Lane To: Ron Johnson cc: pgsql-general Subject: Re: CLUSTER vs. VACUUM FULL In-reply-to: References: Comments: In-reply-to Ron Johnson message dated "Sun, 21 Apr 2024 18:07:50 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2870090.1713739514.1@sss.pgh.pa.us> Date: Sun, 21 Apr 2024 18:45:14 -0400 Message-ID: <2870091.1713739514@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron Johnson writes: > Why is VACUUM FULL recommended for compressing a table, when CLUSTER does > the same thing (similarly doubling disk space), and apparently runs just as > fast? CLUSTER makes the additional effort to sort the data per the ordering of the specified index. I'm surprised that's not noticeable in your test case. regards, tom lane