Timing ODBC Function Calls
Information on the time required to run common ODBC function calls can
be displayed by using the timing
command.
When the timing feature is enabled, many built-in ttIsql
commands
report the elapsed runtime associated with the primary ODBC function call corresponding
to the ttIsql
command.
In this example, when running the connect
command several ODBC
function calls run, however, the primary ODBC function call associated with
connect
is SQLDriverConnect
and this is the
function call that is timed and reported.
Command> timing 1; Command> connect "DSN=database1"; Connection successful: DSN=database1;DataStore=/disk1/databases/database1;DatabaseCharacterSet=AL32UTF8; ConnectionCharacterSet=AL32UTF8;PermSize=128; (Default setting AutoCommit=1) Execution time (SQLDriverConnect) = 1.2626 seconds. Command>
The SQLDriverConnect
call took about 1.26 seconds to run.
When using the timing
command to measure queries, the time required
to run the query plus the time required to fetch the query results is measured. To avoid
measuring the time to format and print query results to the display, set the
verbosity
level to 0
before running the query.
Command> timing 1; Command> verbosity 0; Command> SELECT * FROM t1; Execution time (SQLExecute + FetchLoop) = 0.064210 seconds. Command> timing 1; Command> prepare 2 select 2 from dual; Execution time (SQLPrepare) = 0.000385 seconds. Command> exec 2; Execution time (SQLExecute) = 0.000042 seconds. Command> verbosity 0; Command> fetchall 2; Execution time (Fetch Loop) = 0.000050 seconds.