Hi, On Thu, Jun 25, 2026 at 4:37 AM Masahiko Sawada <[email protected]> wrote: > > The proposed column name 'sent_bytes' is also confusing to me, because > I don't think we can call it "total bytes actually sent" in the > logical decoding SQL API case. A name like 'plugin_total_bytes' seems > more straightforward and conveys the intent that protocol messages are > not included. >
Thank you for sharing your perspective. I agree that sent bytes doesn't entirely reflect the bytes transmitted over the wire, rather, it represents the total bytes emitted during the output plugin write cycle. In the walsender path, currently sent bytes = ctx->out->len + 1, which includes: - plugin output - 25-byte WALData header added by OutputPluginPrepareWrite() - 1-byte CopyData message type In the SQL path, sent bytes = ctx->out->len + 12, which includes: - plugin output - XLogRecPtr - XID tuple column payloads With this in mind, it may be worth considering a rename for sent bytes to plugin_total_bytes, or maybe plugin_output_bytes, or simply output_bytes. That said, it would be great to hear what others think before making a decision. -- With Regards, Ashutosh Sharma.
