Neoview ODBC Drivers Manual (R2.5)

Query ID (SQL_CHAR)
CPUTime (SQL_DOUBLE): An estimate of the number of seconds of processor time it might
take to execute the instructions for this query. A value of 1.0 is 1 second.
IOTime (SQL_DOUBLE): An estimate of the number of seconds of I/O time (seeks plus data
transfer) to perform the I/O for this query.
MsgTime (SQL_DOUBLE): An estimate of the number of seconds it takes for the messaging
for this query. The estimate includes the time for the number of local and remote messages
and the amount of data sent.
IdleTime (SQL_DOUBLE): An estimate of the maximum number of seconds to wait for an
event to happen for this query. The estimate includes the amount of time to open a table or
start an ESP process.
TotalTime (SQL_DOUBLE): Estimated cost associated to execute the query.
Cardinality (SQL_DOUBLE): Estimated number of rows that will be returned.
INFOSTATS { stmt-name | cursor-name | sql-stmt }
stmt-name
is the name of a prepared statement. If a case-sensitive statement name is used, you must enclose
it in either single quotes or double quotes.
cursor-name
is an SQL identifier. The name is unique within the containing module or compilation unit. The
maximum length of a cursor name is 128 characters. If a case-sensitive cursor name is used, you
must enclose it in either single quotes or double quotes.
sql-stmt
is any valid SQL query surrounded by either single quotes or double-quotes.
Example of INFOSTATS
Suppose an application prepares a SELECT statement: SELECT * FROM T1. Use
SQLGetCursorName to find the statement name. In this example, the returned statement name
is SQL_CUR_3.
To get statistics for SELECT * FROM T1, the application must allocate another statement
handle and issue SQLExecDirect on INFOSTATS SQL_CUR_3. The statistics are returned as
a result set. Use SQLFetch to retrieve the result.
SQLPrepare:
In: StatementHandle - 0x003A1940, StatementText = "select * from tst1",
TextLength - 18
Return: SQL_SUCCESS=0
SQLGetCursorName:
SQLAllocHandle:
In: HandleType = SQL_HANDLE_STMT=3, InputHandle = 0x003A1720, OutputHandlePtr = 0x00158CF0
Return: SQL_SUCCESS=0
Out: *OutputHandlePtr = 0x003A2158
SQLExecDirect :
In: hstmt = 0x003A2158, szSqlStr = "infostats SQL_CUR_3", cbSqlStr = -3
Return: SQL_SUCCESS=0
Get Data All:
"QueryID", "CPUTime", "IOTime", "MsgTime", "IdleTime", "TotalTime"'
"Cardinality"
"MXID001000862212016119949296982_16_SQL_CUR_3", 0.0996850252442303,
0.1019600014042226, 0.0980000013441895, 0.0980000013441895,
0.1019600014042226, 129.0
1 row fetched from 7 columns
In this example, INFOSTATS is issued directly on the SQL statement. Again, use SQLFetch to
retrieve the result:
SQLExecDirect:
In: hstmt = 0x003B1968
szSqlStr = "infostats "select * from t1"", cbSqlStr = -3
28 HP Neoview ODBC Driver Overview for Windows