Re: making tid and HOTness of UPDATE available to logical decoding plugins

Matthias van de Meent <boekewurm+postgres@gmail.com>

From: Matthias van de Meent <boekewurm+postgres@gmail.com>
To: Hannu Krosing <hannuk@google.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Dilip Kumar <dilipkumarb@google.com>, Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Date: 2025-12-08T13:18:54Z
Lists: pgsql-hackers
On Thu, 4 Dec 2025 at 21:58, Hannu Krosing <hannuk@google.com> wrote:
>
> Please find attached a patch that makes tuple ids and info about
> weather it was plain or HOT update available to logical decoding
> callbacks.
>
> Also modified test_decoding to show both tids -
> - old tid has format -(pageno, slot)
> - new tid has format +(pageno, slot)
> if it is a HOT update, it is decoded prefixed with 'HOT '

I don't think this added information has meaning in a logical database
framework; I see only demerits in adding this. No query reaches for
tuples by TID unless the query concerns the physical layout of the
data, in which case it isn't a logical query anymore.

One more concern about this is that this may require significant
additional effort in CLUSTER/REPACK -related operations, as those
operations rewrite which TIDs are associated with any logical tuple.
Currently, this never requires a rewrite of the remote table, but by
effectively exposing the TID as addressable column that change must be
considered a possible update of the remote values, and thus requires
logical processing; increasing the cost of those operations in
logical-enabled databases by a huge margin.

Kind regards,

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