| От | Tom Lane |
|---|---|
| Тема | Re: RE: RE: Re: select substr??? |
| Дата | |
| Msg-id | 5197.987187128@sss.pgh.pa.us обсуждение |
| Ответ на | RE: RE: Re: select substr??? (Jeff Eckermann <jeckermann@verio.net>) |
| Список | pgsql-sql |
Jeff Eckermann <jeckermann@verio.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
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера