Thread: Calling functions inside a function: behavior
Hi all, I wrote a function that call another functions, like this: FUNCTION (...) AS '(...)BEGIN PERFORM FUNCTION1(); PERFORM FUNCTION2(); (...) END;' LANGUAGE 'PLPGSQL'; The problem is that takes a long time to execute (I stoped after three days executing). To see who taking more time to execute, I modified each one to return the time of its execution. Then, a made a scrip like: SELECT TIMESTAMP 'NOW'; SELECT FUNCTION1(); SELECT FUNCTION2(); (...) SELECT TIMESTAMP 'NOW'; and, for my surprise, it take minutes to run. I read the documentation and I didn't found any coment abou this behavior. Can anyone explain this? Thank you, Edipo Elder [edipoelder@ig.com.br] _________________________________________________________ Oi! Voc� quer um iG-mail gratuito? Ent�o clique aqui: http://www.ig.com.br/paginas/assineigmail.html
On Mon, Apr 02, 2001 at 08:50:32AM -0300, Edipo Elder Fernandes de Melo wrote: > > and, for my surprise, it take minutes to run. I read the documentation > and I didn't found any coment abou this behavior. Can anyone explain this? Cool, one more Brazilian in the list :) I don't see any difference between calling the functions with a select or a perform, except that with perform the return value is discarded.What version of PG are you running and what are thosefunctions written in (PL/pgSQL, PL/Tcl, PL/Perl)?Can you post a snippet of the functions here? -Roberto -- +----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU - http://www.brasileiro.net http://www.sdl.usu.edu - Space Dynamics Lab, Developer TOFU -> Text Oben Fullquote Unten