Re: IMMUTABLE bug ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: IMMUTABLE bug ?
Date
Msg-id 7652.1130347926@sss.pgh.pa.us
Whole thread Raw
In response to IMMUTABLE bug ?  (strk <strk@keybit.net>)
List pgsql-hackers
strk <strk@keybit.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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: [BUGS] BUG #1993: Adding/subtracting negative
Next
From: Tom Lane
Date:
Subject: Re: Libpq optimization