Skip to content

Commit 2903f14

Browse files
Enable deduplication in system catalog indexes.
The "equality implies image equality" opclass infrastructure disallowed deduplication in system catalog indexes and TOAST indexes before now. That seemed like the right approach back when the infrastructure was added by commit 612a1ab, since ALTER INDEX cannot set deduplicate_items to 'off' (due to an old implementation restriction). But that decision now seems arbitrary at best. Remove special case handling implementing this policy. No catversion bump, since existing catalog indexes will still work. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-Wz=rYQHFaJ3WYBdK=xgwxKzaiGMSSrh-ZCREa-pS-7Zjew@mail.gmail.com
1 parent 9b8d68c commit 2903f14

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/backend/access/nbtree/nbtutils.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,18 +2698,6 @@ _bt_allequalimage(Relation rel, bool debugmessage)
26982698
IndexRelationGetNumberOfKeyAttributes(rel))
26992699
return false;
27002700

2701-
/*
2702-
* There is no special reason why deduplication cannot work with system
2703-
* relations (i.e. with system catalog indexes and TOAST indexes). We
2704-
* deem deduplication unsafe for these indexes all the same, since the
2705-
* alternative is to force users to always use deduplication, without
2706-
* being able to opt out. (ALTER INDEX is not supported with system
2707-
* indexes, so users would have no way to set the deduplicate_items
2708-
* storage parameter to 'off'.)
2709-
*/
2710-
if (IsSystemRelation(rel))
2711-
return false;
2712-
27132701
for (int i = 0; i < IndexRelationGetNumberOfKeyAttributes(rel); i++)
27142702
{
27152703
Oid opfamily = rel->rd_opfamily[i];

0 commit comments

Comments
 (0)