Stored Procedure use and Table reads
Posted in 1997
Hi,
I am new to stored procedures. My understanding is that stored
procedures are suppose to to reduce the number of opens and the user cpu
that it uses. But I executed the following stored procedure about 100000
time in a loop expecting the number of reads to be low,
create procedur "informix".testproc ()
define a_var long;
select a.b into a_var FROM a wHERe a.b = 1
end procedure
This procedure was executed through the following loop
int i;
for ( i=0;i<100000;i++)
execute procedure testproc();
if I run this procedure as DBA the number of opens,bufreads and usercpu
remains low. If I run as any body else with anyother kind of permission the
number of opens,bufread,usercpu goes in way up. Though informix manual says
that execute permission exist for public the informix Engine seems to be
checking for the permission.
My question is is there a way to get around this problem.
I have tried the following
grant "PUBLIC" as informix for the stored procedure.
grant resourse to PUBLIC
grant EXECUTE to the Stored procedure.
Thanks
Ramesh