Re: 4GL Prepare vs Stored Procedure ?
Posted in 1997
>Suppose I 4GL prepare an insert, or select say. > >Suppose I have a stored procedure which does the same thing. ( The >execution of which I realise I need to Prepare ). > >Is it faster, slower, the same, to use the 4GL prepared insert or call the >stored procedure? The prepared statement will usually be a little faster. BUT -- it depends. The stored procedure will generally run a little slower than compiled code because the engine has to find the procedure, load the procedure, pass control to the procedure, etc. This is generally slower than the execution of an already prepared statement. However, if you are running on 7.x (6.x), and the stored procedure is used fairly often, then it is probably already loaded in memory and has already been prepared. Thus, you will be able to bypass the optimization phase and build statement execution tree by executing the procedure. In that case, the execution of the stored procedure would usually be a shorter code path than the prepare would be. Madison Pruet