| From: | Enrico Weigelt <weigelt(at)metux(dot)de> |
|---|---|
| To: | pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: immutable functions vs. join for lookups ? |
| Date: | 2005-04-17 06:06:04 |
| Message-ID: | 20050417060603.GA23283@nibiru.borg.metux.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Enrico Weigelt <weigelt(at)metux(dot)de> 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: contact(at)metux(dot)de
cellphone: +49 174 7066481
---------------------------------------------------------------------
-- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jaime Casanova | 2005-04-17 08:37:07 | Re: immutable functions vs. join for lookups ? |
| Previous Message | Hannes Dorbath | 2005-04-16 10:45:30 | Re: Query Optimizer Failure / Possible Bug |