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 1ryvjq-0018bi-8c for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 15:37:50 +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 1ryvjo-006an4-NA for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 15:37:48 +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 1ryvjo-006alN-AN for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 15:37:48 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ryvjl-00465i-Sg for pgsql-general@postgresql.org; Mon, 22 Apr 2024 15:37:47 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-232f2b86e4fso1916831fac.3 for ; Mon, 22 Apr 2024 08:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713800265; x=1714405065; 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=wgWgWhlbSnwVcI+qTh6cyzk4Yl4gjyYIzviQgrSqO78=; b=jF3KWNvThsZgJuA4TVok+UkAD4cblnC8zAAjfz7E38bDb4E96dhksYDalfRHkV+hXh GPcdQleHj5MTnVjJFrovDwjWBofiNq/K8xsBxmEDDjjgYJvtvIKgNHE3dvHViFFe/PCc WQUxRpK/j77e3a9CUch1mxulInr8fMsLrPl8LXcN/AMBmmjcI/yRjB36lXGGlzCkGaLW QHRRAFaV9ShpcxY1knhJr7OP8W4r++zugrR8w/kLt5sz9kivWhtWv37uhsRP0dKPgnhe oWss0lNE4BT7uCNRL6jAQQlsejVcIXwz/ndBHVJmBC6pnL/vs/9oVWPF6kQTBmcN7n2H ebIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713800265; x=1714405065; 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=wgWgWhlbSnwVcI+qTh6cyzk4Yl4gjyYIzviQgrSqO78=; b=IL1rS3deRLDbZz/TJ4oX00gS475tl6+LLJaCwdph9wLrdSL0T20ccSz7L4ak5ytB7X RONLz8zub6BNytY8avH9QtjmFTMG/YyQDDRnDJEADXGh1ntzueOVDL1fj7X4qmcjhEiY x0OsS61bt6iVDDcjXCXTrEKyQ9ISOTktzMrokFXJJjvXubabetQ1asOtNpYFobiPsKBT 221qKq4k5OV5kKg95ZEJfnhs+NfE/4XlfcpDegSevmR7GPXFrIvV/W1mPB9EbTHSQXxN di/iOsU6VrAYXdikkHwHhjlOrtX6x4F8hx0nvuHv4sM2Gp1Gx2vCaAJR/9psS+ZEEO0f jznA== X-Gm-Message-State: AOJu0YzcrVp9pC5UI68bSaJ3+tQ4BzxrikajHL0VcFZ1I5ucnobuGy+Y BRMQJSVKFCvu9WF+CNJgT67nSD3f+TZZx54Jhbv8ynUYzQgHKYYYJHYtAD1LsEEagjAne1YCJ8g S+9iizmPviC0NpbyU/8pjE/mW0bTrpg== X-Google-Smtp-Source: AGHT+IFJAfheuGpQ37DBowjcAtlEZKFO2+py6DeIcMJcd+kBfqeUiHiIwY7+15Zlq2Rt7XsmhEN7j3VE0X3Baz1QPPg= X-Received: by 2002:a05:6871:203:b0:222:90a1:596f with SMTP id t3-20020a056871020300b0022290a1596fmr11981203oad.49.1713800265101; Mon, 22 Apr 2024 08:37:45 -0700 (PDT) MIME-Version: 1.0 References: <2870091.1713739514@sss.pgh.pa.us> <3043219.1713795953@sss.pgh.pa.us> In-Reply-To: <3043219.1713795953@sss.pgh.pa.us> From: Ron Johnson Date: Mon, 22 Apr 2024 11:37:33 -0400 Message-ID: Subject: Re: CLUSTER vs. VACUUM FULL To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000000478b90616b13838" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000478b90616b13838 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 22, 2024 at 10:25=E2=80=AFAM Tom Lane wrote= : > Marcos Pegoraro writes: > > But wouldn't it be good that VACUUM FULL uses that index defined by > > Cluster, if it exists ? > > No ... what would be the difference then? > What the VACUUM docs "should" do, it seems, is suggest CLUSTER on the PK, if the PK is a sequence (whether that be an actual sequence, or a timestamp or something else that grows monotonically). That's because the data is already roughly in PK order. --0000000000000478b90616b13838 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 22, 2024 at 10:25=E2=80=AFAM = Tom Lane <tgl@sss.pgh.pa.us>= wrote:
Marcos Pegoraro <marcos@f10.com.br> writes:
> But wouldn't it be good that VACUUM FULL uses that index defined b= y
> Cluster, if it exists ?

No ... what would be the difference then?
=C2=A0
=
What the VACUUM docs "should" do, it seems, is suggest CLUST= ER on the PK, if the PK is a sequence (whether that be an actual sequence, = or a timestamp or something else that grows monotonically).

<= /div>
That's because the data is already roughly in PK order.
=

--0000000000000478b90616b13838--