Re: IMMUTABLE bug ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: strk <strk(at)keybit(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Mark Cave-Ayland <m(dot)cave-ayland(at)webbased(dot)co(dot)uk>
Subject: Re: IMMUTABLE bug ?
Date: 2005-10-26 17:32:06
Message-ID: 7652.1130347926@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

strk <strk(at)keybit(dot)net> writes:
> Why is so ? shouldn't the IMMUTABLE keywork make
> it a single call ?

No. There is no function value cache. What does happen here is that
the planner folds those calls to constants at plan time, instead of at
run time. Try

select testme(1) from some-table-with-multiple-rows

and note there's only one call not N.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-10-26 17:37:49 Re: Libpq optimization
Previous Message Kevin Grittner 2005-10-26 17:30:58 Re: [BUGS] BUG #1993: Adding/subtracting negative