pgsql: Remove unused tuple fetch in speculative completion

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove unused tuple fetch in speculative completion
Date: 2026-07-07 22:17:23
Message-ID: E1whE6U-0003Vl-2H@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove unused tuple fetch in speculative completion

heapam_tuple_complete_speculative() fetched a tuple from the slot only
to free it immediately afterwards, without ever using it.

The function only needs slot->tts_tid to complete or abort the
speculative insertion, so remove the unnecessary fetch and pfree().

Author: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Japin Li <japinli(at)hotmail(dot)com>
Reviewed-by: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Reviewed-by: Surya Poondla <suryapoondla4(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/FCB61654-575D-4F08-AA7E-ED462EDE48A7@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7258c891d4cabd366e4529484f2ad6e99234db48

Modified Files
--------------
src/backend/access/heap/heapam_handler.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-07-07 22:34:23 pgsql: unicode_case.c: change API to signal UTF8 decoding error.
Previous Message Jeff Davis 2026-07-07 22:05:35 pgsql: pg_unicode_fast: fix final sigma logic.