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

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема [PATCH] nbtree: Do not show debugmessage if deduplication is disabled
Дата
Msg-id 20201217012831.GT30237@telsasoft.com
обсуждение исходный текст
Ответы Re: [PATCH] nbtree: Do not show debugmessage if deduplication is disabled  (Peter Geoghegan <pg@bowt.ie>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Proposed patch for key managment
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: SELECT INTO deprecation