Prepared Stmts Or Sp
Posted in 1994
I need to optimize some applications already done using ESQL/COBOL
and SE 5.0. Most of these applications have a big loop (executed
the whole day) with a lot of SQL statements inside. The systems
we are using (MX 300 Siemens) have a small amount of memory and
suffer of memory contention problems.
From a performance standpoint are Stored Precedures better than
Prepared SQL Statements?
Es.
Program 1.
.
.
stmt1 = "update tab_name set col1 = ?"
prepare quid from stmt1
while true
var1 = host-var + 1
execute quid using var1
.
.
Program 2
.
.
create procedure proc1(param int)
update tab_name set col1 = param; end procedure
.
.
while true
var1 = host-var + 1
execute procedure proc1(var1)
.
.
From a performance standpoint;
- which one will requiere less memory?
- which one will be faster?
- which one will cause less pippe traffic between the front-end and
the back-end?
- which one will cause less disk access?
Thanks very much
Agostino Brunamontini
Srd. Rome. Italy.