Re: Missed bet in toaster routines - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Missed bet in toaster routines
Date
Msg-id 4007F8A2.8010002@Yahoo.com
Whole thread Raw
In response to Missed bet in toaster routines  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Missed bet in toaster routines  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 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.

Why sure it would. That code is quite frequently called.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Question regarding pfree and thread safety.
Next
From: "Marc G. Fournier"
Date:
Subject: And ppl complain about *our* beta cycles ...