I bet someone knows before I launch into a bunch of testing... Will a
procedure run faster then identical code ran via a RUNSQLSTMT. If so,
is it a lot faster or just a few nanoseconds between friends?
Printable View
I bet someone knows before I launch into a bunch of testing... Will a
procedure run faster then identical code ran via a RUNSQLSTMT. If so,
is it a lot faster or just a few nanoseconds between friends?
Mike LaFountain wrote:[color=blue]
> I bet someone knows before I launch into a bunch of testing... Will a
> procedure run faster then identical code ran via a RUNSQLSTMT. If so,
> is it a lot faster or just a few nanoseconds between friends?[/color]
I don't know, but I'm guessing the procedure will run
faster, because it's a compiled C program. I have no
idea what the speed difference might be, if any.
On 8 Giu, 22:01, Mike LaFountain <mlafo...@gmail.com> wrote:[color=blue]
> I bet someone knows before I launch into a bunch of testing... Will a
> procedure run faster then identical code ran via a RUNSQLSTMT. If so,
> is it a lot faster or just a few nanoseconds between friends?[/color]
It depends: I think that normally a stored procedure is faster because
it uses static SQL. RUNSQLSTMT uses SQL Dynamic and the query must be
optimized every time you run the statement (except if you use latest
version of OS/400): if the query is very complex (join of many tables)
the optimization can take some seconds... Moreover the second phase
(open the data path) can be faster using a stored procedure because SP
reuses Open data path. Dynamic SQL (RUNSQLSTMT) can not reuses ODP.