top | item 37300911

(no title)

telios | 2 years ago

The post makes mention of B-tree de-duplication that is present in PostgreSQL 13, but not 12, the version they're using; at the same time, they're noting that the vast majority of values in some of their foreign key indexes are NULL.

I have to wonder if B-tree de-duplication would have helped with that particular case? The PostgreSQL 13 documentation seems to imply it, as far as I can tell[0] (under 63.4.2):

> B-Tree deduplication is just as effective with “duplicates” that contain a NULL value, even though NULL values are never equal to each other according to the = member of any B-Tree operator class.

I don't think it would be as effective as a partial index as applied in the post, I'm just curious.

[0]: https://www.postgresql.org/docs/13/btree-implementation.html

discuss

order