RE: SET EXPLAIN question
Posted in 1997
Jeff Craig responded to Scott Campbell:
>>Is anyone out there aware of a way to override sqexplain.out as the
>>default output file for SET EXPLAIN? I want to send the output to a
>>different file whose name is based on a session ID.
>>
>>Thanks in advance,
>>Scott
>>
>>
>I've never tried it, but if you could figure out the session
>identifier for a session you've just entered, you could do
>this:
>/usr/people/informix> dbaccess stores7 <<EOF
>} ! rm sqexplain.out
>} ! ln -s sqexplain.out yourfilename.out
>} SELECT *
>} FROM ORDERS
>} ;
>} EOF
>
>The ! shells out so you can execute UNIX system commands. The
>ln -s command creates a symbolic link named sqexplain.out.
>When Informix writes to sqexplain.out, you end up with a real
>file named yourfilename.out.
>
>If you figure out how to get the session identifier, or if you
>figure out another way to accomplish your goal, please share.
This sounds like an excellent idea. All you have do to is get the users =
to type:
EXECUTE PROCEDURE SET_EXPLAIN_ON();
and write an SPL which does as Jeff has suggested. This highlights =
something I'd really like to see:
CONNECT TRIGGERS
I would really like to be able to centralise configuration issues within =
the engine itself. Our installation is a big (>200Gb) warehouse, and =
every program has to set isolation levels, PDQ resources and lock modes, =
because the (in our case inapprioriate) defaults are not =
site-configurable. This is done at the application level (ESQL/C, =
ESQL/COBOL, 4GL, DBACCCESS) etc, and requires the user knowing and =
_remembering_ to do it (especially problematic in ad-hoc DBACCESS)
Wouldn't it be nice to make this global and automatic with a CONNECT =
TRIGGER? Functionality like that would make the SET ROLE statement a lot =
more useful also!
I'm sure others could see a use for this, and I'm not redirecting my =
output to /dev/null... :)
RET
+--------------------------------------------------------------------------=
--+
| Richard Thomas (DBA) richard_thomas@yes.optus.com.au +61 2 9342 =
7188 |
+--------------------------------------------------------------------------=
--+