Thread: Re: [GENERAL] Prepared statement performance...

Re: [GENERAL] Prepared statement performance...

From
Neil Conway
Date:
Dmitry Tkach <dmitry@openratings.com> writes:
> - a general solution, that would involve extending postgres SQL gramma
> to include a 'prepare' statement

As someone else mentioned, this has been implemented for 7.3. I
implemented PREPARE/EXECUTE/DEALLOCATE on the backend side, Barry Lind
(I believe) added support for using backend prepared statements to the
JDBC driver.

> The second solution is not only ugly (because it requires the
> application code to be changed and to have a specialized stored
> procedure for every query), but also requires some additional hacks
> (to overcome the hard limit on the number of function arguments and
> the inability for functions to return tuples)

Note that in 7.3, functions can return sets of tuples.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Re: [GENERAL] Prepared statement performance...

From
Neil Conway
Date:
Dmitry Tkach <dmitry@openratings.com> writes:
> Any chance to get a patch that could be applied over a 7.2 source?

I'm not planning to -- but since the PREPARE/EXECUTE stuff is almost
entirely separated from the rest of the system, it would probably be
pretty easy to do.

> >Note that in 7.3, functions can return sets of tuples.

> Yeah... I know that... But, same comment as above applies - the
> migration is what scares the hell out of me :-(

FYI, backpatching this to 7.2 would not be feasible.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC