Subject Re: Speed difference question
Author tomsee7
> In the latter one,
> the whole SQL statement is being re-prepared every time.

Is that right? Maybe there's a misunderstanding to my question?

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 firebird-support@yahoogroups.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.
>
>
> Dmitry
>