Re: CLUSTER on partitioned index

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, 李杰(慎追) <adger(dot)lj(at)alibaba-inc(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, 曾文旌(义从) <wenjing(dot)zwj(at)alibaba-inc(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>
Subject: Re: CLUSTER on partitioned index
Date: 2022-03-31 10:54:36
Message-ID: 202203311054.fk6zeitz4nq5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I realized after posting that we used to allow clustering toast tables,
but after my changes we no longer do. (Justin's version had a
RELKIND_HAS_STORAGE test here instead, which seemed a little too lax.) I
don't know why we allowed it and I don't know of anyone who has ever
used that feature and we don't have any test coverage for it, but I
don't have any reason to explicitly disallow it either. So I propose to
continue to allow it:

>From 05ba6124422fb7c2fd19575e905e444ba3eef1e5 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Date: Thu, 31 Mar 2022 12:49:57 +0200
Subject: [PATCH] allow to cluster toast tables

---
src/backend/commands/cluster.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index 8417cbdb67..b391d7c434 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -451,7 +451,8 @@ cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params)
}

Assert(OldHeap->rd_rel->relkind == RELKIND_RELATION ||
- OldHeap->rd_rel->relkind == RELKIND_MATVIEW);
+ OldHeap->rd_rel->relkind == RELKIND_MATVIEW ||
+ OldHeap->rd_rel->relkind == RELKIND_TOASTVALUE);

/*
* All predicate locks on the tuples or pages are about to be made
--
2.30.2

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Java is clearly an example of money oriented programming" (A. Stepanov)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-03-31 10:56:20 Re: Commitfest Update
Previous Message Julien Rouhaud 2022-03-31 10:46:59 Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.