Re[2]: Set Explain
Posted in 1997
jrichard@mail.ci.aurora.co.us wrote:
>
> We have programmers who are sending code to production with set
> explains still in the code. Since we get binaries, we have trying to
> figure out a way to stop the set explains from executing and creating
> gigantic files. Any ideas???
Rather than firing the programmers, how about disallowing the use of "set
explain" directly in any application code; write a shared function to do this
which will only execute the "set explain" statement if a specific environment
variable is set? Eg:
call DoSetExplain()
FUNCTION DoSetExplain()
if fgl_getenv( 'SQLEXPLAINON' ) is not null
then
set explain on
end if
END FUNCTION
In our project we simply do this as part of the start-up function for all
programs, so it only gets set once, for whole program - we find that this is
enough.