Re: how do you call one pltcl function from another?
От | Jan Wieck |
---|---|
Тема | Re: how do you call one pltcl function from another? |
Дата | |
Msg-id | 200011091422.JAA01249@jupiter.jw.home обсуждение исходный текст |
Ответ на | Re: how do you call one pltcl function from another? ("Jonathan Ellis" <jellis@advocast.com>) |
Список | pgsql-general |
Jonathan Ellis wrote: > > You need to call it via SPI like > > > > spi_exec "select meta_class($1) as retval" > > return $retval > > What kind of performance hit is there doing this vs two plpgsql functions? > IIANM, you're creating two separate tcl interpreters this way, which seems > expensive. You are actually calling the same interpreter again through the SPI interface (parser, planner, optimizer, executor). Really expensive. Someone can skip anything but the executor by preparing a saved plan, but that's still a waste of CPU. At the very least, calling one function from the other is expensive in any procedural language, that must use a general solution because the called function could be defined in any language. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #
В списке pgsql-general по дате отправления: