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 1ryhLo-0001Dq-Qh for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 00:16:04 +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 1ryhLn-00Gca0-6d for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 00:16:03 +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 1ryhLm-00GcZs-Rr for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 00:16:02 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ryhLk-003zQT-IX for pgsql-general@postgresql.org; Mon, 22 Apr 2024 00:16:01 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5aa26990d5aso2546427eaf.1 for ; Sun, 21 Apr 2024 17:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713744959; x=1714349759; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=E1pZIUpgfRtVDYiBhOOl0qXT/RRb9XXozCMyRGuaJz4=; b=XxoikBTcrmS7Wf8aAqqzyPkSlWkzWwKXbSxhasHDMQPuhz/LBsmBSfueYis7tyXCe4 5DJoGa/VfccJhTKMCds/BbceEj5//RwW1N2s7WAAVn8R8QQr2R2uLlF9eghwM92fbDwc M011ABguyCgx1D5+4dGwXufQ7BH4wUZP7gZiFyJWQUbbStLTIE23jQjjFdTU5x+Brovl EUMWM+WGxbBrjZhCEgHS+DsaK1dSmhSAFKtLWiDrsDUxXEa9k0n3Idv8IrNDWd9qv/oN pgG4fAsIAQFgsyxAXky0DWN4UIrO42pRWPDpHGVW5MqwX3an9g5zAxsgZE+aP6gaJTfB Pu2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713744959; x=1714349759; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E1pZIUpgfRtVDYiBhOOl0qXT/RRb9XXozCMyRGuaJz4=; b=WuOuwLfbd3gtyFuZIlTT/NPlgPh/keSAbh2ynnv93xU2saqIAOchJyw0tVdEzAXg5t 9g87cmHtgax/p2TIJGY0WSQGpScZIQNrjF3kPCRkA+WrIn4llJrX0T2D71TZYnQki9DU RcSTjmmDH13t9WtmyBWgAOmckixBpP686Joc/2CH88ChbCQ2/5HyraLmMVHeDDedXMAN RwMwBVxGoDGWu5SB9D6V0SFhf7x4u49sl7xRKew6H4ho60MYusY9yV0H1ksYORdtBaB7 2r4vAO6oTZTKnxrTptbT1O5LQ4d4NxSuINT58xPJ/dPZ6pgXNgzzxJokNErSfUl2Q8H0 ZG1Q== X-Gm-Message-State: AOJu0YzfQDe65NCQdhxyfSSjgPI2BL9mFBFDSsxzexIZ4iM3I3De33lU qv6BFi0f9noSA1fia/SA5hS9Dn0RM0XSdUgwAC4L5vdJV+loiqKKxlMmYUxnVqwwpeu6u0vL6w9 RqKLQW3rNExUWDnth/lU6CKKW4ddy+g== X-Google-Smtp-Source: AGHT+IH45zFgPfzV6oRGDCVIs3+iOw2x4dmgWo0bmz2nDJ11MKbpQRHwElB8y9EcG8eYZyIoOvbO432sGERIQyrEegw= X-Received: by 2002:a05:6870:1318:b0:21f:aba0:772d with SMTP id 24-20020a056870131800b0021faba0772dmr9164112oab.39.1713744959422; Sun, 21 Apr 2024 17:15:59 -0700 (PDT) MIME-Version: 1.0 References: <2870091.1713739514@sss.pgh.pa.us> In-Reply-To: <2870091.1713739514@sss.pgh.pa.us> From: Ron Johnson Date: Sun, 21 Apr 2024 20:15:48 -0400 Message-ID: Subject: Re: CLUSTER vs. VACUUM FULL To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000008aca550616a457bc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008aca550616a457bc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 21, 2024 at 6:45=E2=80=AFPM Tom Lane wrote: > Ron Johnson writes: > > Why is VACUUM FULL recommended for compressing a table, when CLUSTER do= es > > the same thing (similarly doubling disk space), and apparently runs jus= t > 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. > Clustering on a completely different index was also 44 seconds. --0000000000008aca550616a457bc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Apr 21, 2024 at 6:45=E2=80=AFPM T= om Lane <tgl@sss.pgh.pa.us> = wrote:
Ron Johnson <ronljohnsonjr@gmail.com> writes:
> Why is VACUUM FULL recommended for compressing a table, when CLUSTER d= oes
> the same thing (similarly doubling disk space), and apparently runs ju= st as
> fast?

CLUSTER makes the additional effort to sort the data per the ordering
of the specified index.=C2=A0 I'm surprised that's not noticeable i= n your
test case.

Clustering on a completely d= ifferent index=C2=A0 was also 44 seconds.
--0000000000008aca550616a457bc--