[PATCH] nbtree: Do not show debugmessage if deduplication is disabled

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] nbtree: Do not show debugmessage if deduplication is disabled
Date: 2020-12-17 01:28:31
Message-ID: 20201217012831.GT30237@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Even though the message literally says whether the index "can safely" or
"cannot" use deduplication, the function specifically avoids the debug message
for system columns, so I think it also makes sense to hide it when
deduplication is turned off.

diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 2f5f14e527..b78b542429 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -2710,6 +2710,9 @@ _bt_allequalimage(Relation rel, bool debugmessage)
if (IsSystemRelation(rel))
return false;

+ if (!BTGetDeduplicateItems(rel))
+ return false;
+
for (int i = 0; i < IndexRelationGetNumberOfKeyAttributes(rel); i++)
{
Oid opfamily = rel->rd_opfamily[i];
--
2.17.0

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-12-17 01:30:17 Re: SELECT INTO deprecation
Previous Message Michael Paquier 2020-12-17 01:24:56 Re: Proposed patch for key managment