Re: RE: RE: Re: select substr???

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Eckermann <jeckermann(at)verio(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: RE: RE: Re: select substr???
Date: 2001-04-13 18:38:48
Message-ID: 5197.987187128@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jeff Eckermann <jeckermann(at)verio(dot)net> writes:
> You are correct, the check for "$1 is null" is not required. I was
> attempting an optimisation, as in "don't do anything else if this is null".
> The gain would depend on how much further processing the function would
> attempt before recognizing that it was dealing with a null value, which is
> something that I don't know enough to tell.

In 7.1, checking for null would be appropriate unless you've declared
the function "strict". A strict function won't even be called for null
input, rather a null result will be assumed automatically --- with much
less overhead than an explicit test for null would need.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Lonnie Cumberland 2001-04-13 18:57:14 Re: Calling plSQL functions
Previous Message Tom Lane 2001-04-13 18:35:49 Re: Calling plSQL functions