I’m having a weird bug in gathering my IO statistics from DB queries.
The way it LOOKS like to me (without proof) is that for no discernable reason, one of the queries that gets run, gets its set statistics io to OFF.
Is there any way in Sybase to query out whether set statistics io is ON or OFF?
NOTE: it shouldn’t matter to my main question (in bold above) but the higher level problems is as follows:
-
I am using DBI module in Perl to connect to Sybase.
-
I’m running the following code:
Run_Query("set statistics io on"); Run_Query("set showplan on"); Run_Query("$query1"); Run_Query("$query2"); # ... Run_Query("$queryN"); Run_Query("set statistics io off"); Run_Query("set showplan off"); -
For some reason,
$query3prints the showplan output from the DBI callback but NOT statistics IO ouput. -
I would like to check if for some reason “”set statistics io off” is called earlier.
There is one way to check it, but it’s not so simply.
You can use this variable:
It will show you all session’s set options, but it’s a hexadecimal representation :).
Here on the bottom there is a table, which has descriptions about values of
@@options.I tested it, on 14th position there is
2orA, it depends onset statistics iostate: