Jan Wieck wrote:
>
> 1. I've just committed some changes to PL/pgSQL and the SPI
> manager.
>
> It's a speedup of PL/pgSQL execution by calling
> ExecEvalExpr() in the executor directly for simple
> expressions that return one single Datum.
>
...
>
> To be able to do so I've moved some of the declarations
> from spi.c into a new header spi_priv.h so someone has
> access to the _SPI_plan structure for past preparing
> plan-/querytree analysis. And I've added two silly
> functions SPI_push() and SPI_pop() that simply
> increment/decrement the _SPI_curid value. This is
> required for calling ExecEvalExpr(), because there could
> be functions evaluated that use SPI themself and
> otherwise they could not connect to the SPI manager. They
> are dangerous and I'm in doubt if we should document
> them.
BTW, Jan, did you consider ability to add new function
for fast expression evaluation to SPI itself and than just
use this func in PL/pgSQL?
This function seems to be generally usefull.
And we could avoid SPI_push/SPI_pop...
Vadim