Here's version 3 of the patch, which is no more than a rebase.

Short recap: pg_datum_image_equal(any, any) -> bool allows
synchronization tools to reliably detect that colum values have not
changed in any way, for every type. Without this function, e.g.
numeric and jsonb columns wouldn't have a correct strict equality test
on the type itself (you'd have to cast to string and use a C-collated
equality against the string representation, which is relatively more
expensive). With this new function the UPDATE operation can use CASE
WHEN <equal> THEN old_val ELSE new_val END CASE; thus skipping
re-toasting the new value, reducing TOAST churn and also avoiding some
unneeded non-HOT updates in such synchronization workloads.


Kind regards,

Matthias van de Meent
Databricks (https://www.databricks.com)

p.s. The upthread issues with datum_image_*() have been resolved in 0d866282b8.

Attachment: v3-0001-Add-SQL-level-datum-equality-tests.patch
Description: Binary data

Reply via email to