SET EXPLAIN question
Posted in 1999
Topics: Performance & Tuning
I have an application that links several .ec files, and I need to get the explain output in sqexplain.out using SET EXPLAIN ON. How should I place the SET EXPLAIN ON statements : once per file, once per function, once for the entire executable, etc. ? I would like to get the output for each query executed by the program. The manual for 7.2 does not seem to explain this. Thanks and regards, ramsub
M Ramasubramanian wrote:
>
> I have an application that links several .ec files, and I need to get the
> explain output in sqexplain.out using SET EXPLAIN ON. How should
> I place the SET EXPLAIN ON statements : once per file, once per
> function, once for the entire executable, etc. ? I would like to get the
> output for each query executed by the program. The manual for 7.2
> does not seem to explain this.
SET EXPLAIN... turns explain processing on or off from the point ofexecution to the end of the session or the next reversing SET EXPLAIN
statement. So to trap all statements place the SET EXPLAIN ON after
the DATABASE or CONNECT TO statement and before the execution of any
queries. Place the SET EXPLAIN OFF before exiting the program or
executing a DISCONNECT statement.
Art S. Kagel
Remember, the 'sqlexplain.out' file doesn't get flushed until the end of the
session.
-Dino
Art S. Kagel wrote:
> M Ramasubramanian wrote:
> >
> > I have an application that links several .ec files, and I need to get the
> > explain output in sqexplain.out using SET EXPLAIN ON. How should
> > I place the SET EXPLAIN ON statements : once per file, once per
> > function, once for the entire executable, etc. ? I would like to get the
> > output for each query executed by the program. The manual for 7.2
> > does not seem to explain this.
>
> SET EXPLAIN... turns explain processing on or off from the point of> execution to the end of the session or the next reversing SET EXPLAIN
> statement. So to trap all statements place the SET EXPLAIN ON after
> the DATABASE or CONNECT TO statement and before the execution of any
> queries. Place the SET EXPLAIN OFF before exiting the program or
> executing a DISCONNECT statement.
>
> Art S. Kagel
Dino Gomez wrote: > Remember, the 'sqlexplain.out' file doesn't get flushed until the end of the > session. Um, if this means what it sounds to me like it means, then I don't think it's true. sqexplain.out is written to as soon as the optimizer finishes processing the query plan. I've never had a problem with this. June -- june_t@hotmail.com Grounded in Palo Alto, living on M&M's (plain)