Missed bet in toaster routines

Started by Tom Laneabout 22 years ago1 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Wouldn't it be a win for heap_tuple_toast_attrs() to fall out quickly
if the tuple contains no varlena attributes? I'm thinking of adding
a test like

/* Nothing to do if tuple contains no varlena fields */
if ((newtup && !HeapTupleAllFixed(newtup)) ||
(oldtup && !HeapTupleAllFixed(oldtup)))
/* do existing processing */

This is a pretty cheap test (just checking a header flag) and saves lots
of useless scanning when it succeeds.

regards, tom lane