[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-hackers
Subject:    [HACKERS] SPI support needed for EXECUTE USING
From:       Tom Lane <tgl () sss ! pgh ! pa ! us>
Date:       2008-03-31 19:43:30
Message-ID: 18858.1206992610 () sss ! pgh ! pa ! us
[Download RAW message or body]

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic