Обсуждение: SPI support needed for EXECUTE USING

Поиск
Список
Период
Сортировка

SPI support needed for EXECUTE USING

От
Tom Lane
Дата:
The proposed EXECUTE USING patch represents a serious performance loss
compared to the traditional method of interpolating parameter values
into the query text, anytime the value of the parameter is important
for planning purposes.  We have fixed that in the Protocol BIND message
context by providing a way to push parameter values into the planning
process, but there is no way for plpgsql to do the same, because it
uses the SPI interface and SPI doesn't expose any way to do it.

I propose adding an additional SPI function along the lines of
int SPI_execute_with_args(const char *src,              int nargs, Oid *argtypes,              Datum *Values, const
char*Nulls,              bool read_only, long tcount);
 

to encapsulate the process of creating a one-shot plan and executing
it with specific parameter values.

Comments?
        regards, tom lane