SPI support needed for EXECUTE USING

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: SPI support needed for EXECUTE USING
Date: 2008-03-31 19:43:30
Message-ID: 18858.1206992610@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Vivek Khera 2008-03-31 19:45:49 Re: PostgreSQL Replication with read-only access to standby DB
Previous Message James Mansion 2008-03-31 19:37:45 Re: POSIX shared memory support