-
Enhancement
-
Resolution: Done
-
Major
-
3.1.3.Final, 3.2.0.Final
-
None
-
False
-
-
False
-
-
In the PostgreSQL UnchangedToastedReplicationMessageColumn class, there is a method called isUnchangedToastValue that checks whether the supplied value is one of the toast object markers.
The problem here is that the method uses the Set#contains method, which requires the use of the supplied object's hash to see whether it matches an element in the Set. For large string values, this is highly inefficient as the hash is calculated lazily.
Ideally, what we should aim for here is a simple equality check to identify whether the supplied value is one of the object markers, which would skip the hash calculation for the value and keep the performance, regardless of value types, consistent.