Re: immutable functions vs. join for lookups ?

От: Enrico Weigelt
Тема: Re: immutable functions vs. join for lookups ?
Дата: ,
Msg-id: 20050417060603.GA23283@nibiru.borg.metux.de
(см: обсуждение, исходный текст)
Ответ на: Re: immutable functions vs. join for lookups ?  (Tom Lane)
Ответы: Re: immutable functions vs. join for lookups ?  (Jaime Casanova)
Список: pgsql-performance

Скрыть дерево обсуждения

immutable functions vs. join for lookups ?  (Enrico Weigelt, )
 Re: immutable functions vs. join for lookups ?  (Tom Lane, )
  Re: immutable functions vs. join for lookups ?  (Enrico Weigelt, )
   Re: immutable functions vs. join for lookups ?  (Jaime Casanova, )
    Re: immutable functions vs. join for lookups ?  (Enrico Weigelt, )
     Re: immutable functions vs. join for lookups ?  (Dawid Kuroczko, )
 Re: immutable functions vs. join for lookups ?  (Dawid Kuroczko, )
 Re: immutable functions vs. join for lookups ?  ("Merlin Moncure", )
  Re: immutable functions vs. join for lookups ?  (Dawid Kuroczko, )
   Re: immutable functions vs. join for lookups ?  ("Jim C. Nasby", )
    Re: immutable functions vs. join for lookups ?  (Dawid Kuroczko, )
     Re: immutable functions vs. join for lookups ?  (Christopher Kings-Lynne, )
     Re: immutable functions vs. join for lookups ?  (Christopher Kings-Lynne, )
  Re: immutable functions vs. join for lookups ?  (Tom Lane, )
   Re: immutable functions vs. join for lookups ?  (Greg Stark, )
    Re: immutable functions vs. join for lookups ?  (Tom Lane, )
     Re: immutable functions vs. join for lookups ?  (Enrico Weigelt, )
      Re: immutable functions vs. join for lookups ?  (Dawid Kuroczko, )

* Tom Lane <> wrote:
> Enrico Weigelt <> writes:
> > c) CREATE FUNCTION id2username(oid) RETURNS text
> >     LANGUAGE 'SQL' IMMUTABLE AS '
> >     SELECT username AS RESULT FROM users WHERE uid = $1';
>
> This is simply dangerous.  The function is *NOT* immutable (it is
> stable though).  When ... not if ... your application breaks because
> you got the wrong answers, you'll get no sympathy from anyone.

In my case it is immutable. The username never changes.


cu
--
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------


В списке pgsql-performance по дате сообщения:

От: Jaime Casanova
Дата:
Сообщение: Re: immutable functions vs. join for lookups ?
От: Alex
Дата:
Сообщение: Re: plperl vs plpgsql