|Subject||Re: Speed difference question|
> In the latter one,Is that right? Maybe there's a misunderstanding to my question?
> the whole SQL statement is being re-prepared every time.
My knowledge is limited but I thought that sending dynamic sql (e.g 'select a,b,c from d where e=?' as part of a prepare statement caused a single preparation on the server.
The client app can then just send the ? param each time thereby giving good performance and a midway option between passing dynamic sql repeatedly and calling stored procedures.
--- In email@example.com, Dmitry Yemanov <dimitr@...> wrote:
> Dimitry Sibiryakov wrote:
> >> Does anyone have an opinion on the likely speed difference between:
> >> 1. Calling a stored procedure repeatedly versus
> >> 2. Sending an sql statement to be prepared and then executing that repeatedly.
> > There is no difference between these cases.
> I'd say it depends on the procedure complexity. In the former case, its
> body is parsed/compiled/optimized just once and all the iterations just
> parse/optimize a trivial EXECUTE PROCEDURE statement. In the latter one,
> the whole SQL statement is being re-prepared every time. But anyway,
> it's unlikely to see much difference in the real life.