> "Tom Lane" wrote in message
> news:25116.1277047...@sss.pgh.pa.us...
>> "Davor J." writes:
>>> Suppose 2 functions: factor(int,int) and offset(int, int).
>>> Suppose a third function: convert(float,int,int) which simply returns
>>> $1*factor($2,$3)+offset($2,$3)
>>> All three functions are IMM
Thanks Tom,
Your concepts of "inlining" and "black box" really cleared things up for me.
With fnc_unit_convert() written in SQL and declared as STABLE I indeed have
fast performance now.
I appreciate the note on the IMMUTABLE part. The table contents should not
change in a way to affect the fu
"Davor J." writes:
> Suppose 2 functions: factor(int,int) and offset(int, int).
> Suppose a third function: convert(float,int,int) which simply returns
> $1*factor($2,$3)+offset($2,$3)
> All three functions are IMMUTABLE.
You should write the third function as a SQL function, which'd allow it
to
I didn't consider them to be important as they showed the same, only the
execution time was different. Also, they are a bit more complex than the ones
put in the previous post. But here they are:
Definitions:
---
CREATE OR REPLACE FUNCTION
2010/6/19 Davor J.
> I think I have read what is to be read about queries being prepared in
> plpgsql functions, but I still can not explain the following, so I thought
> to post it here:
>
> Suppose 2 functions: factor(int,int) and offset(int, int).
> Suppose a third function: convert(float,int,
I think I have read what is to be read about queries being prepared in
plpgsql functions, but I still can not explain the following, so I thought
to post it here:
Suppose 2 functions: factor(int,int) and offset(int, int).
Suppose a third function: convert(float,int,int) which simply returns
$1*