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 1shGWX-00FRp9-Lm for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2024 22:43:21 +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 1shGVX-006Ga2-M8 for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2024 22:42:20 +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 1shGVX-006GZu-B6 for pgsql-general@lists.postgresql.org; Thu, 22 Aug 2024 22:42:19 +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 1shGVU-00119b-3Z for pgsql-general@postgresql.org; Thu, 22 Aug 2024 22:42:19 +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 47MMgFCY2087381; Thu, 22 Aug 2024 18:42:15 -0400 From: Tom Lane To: Morris de Oryx cc: pgsql-general Subject: Re: Is there a way to translate pg_amop.amopstrategy into a description? In-reply-to: References: Comments: In-reply-to Morris de Oryx message dated "Thu, 22 Aug 2024 17:34:39 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2087379.1724366535.1@sss.pgh.pa.us> Date: Thu, 22 Aug 2024 18:42:15 -0400 Message-ID: <2087380.1724366535@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Morris de Oryx writes: > What I'm hoping for is a function like > get_opt_class_strategy_description(optclass, straregy_number) I've > looked at the source a bit, and it seems that there is no such > function, and that it might well be difficult to implement. The > strategy numbers are, as far as I can see, local to the specific > opt_class, which has no requirement to label them in any particular > way. That's correct. For btree and hash, the meanings of the strategy numbers are determined by the index AM; but for (IIRC) all of our other index AMs they're determined by the individual opclass. So anything like this would have to be implemented by dedicated code in each opclass. Perhaps that's worth doing, but it'd be a fair amount of work. regards, tom lane