ODBC Server Installation and Management Manual

Managing NonStop ODBC Server Resources
HP NonStop ODBC Server Installation and Management Manual429395-002
5-9
Usage Considerations
Such items are meaningless in the context of a session. Use per-session basis if the
resource accounting data is to be used for charge-back.
Record Data for Each Statement
If a per-statement basis is specified for the ACC_LEVEL attribute, all metrics are
collected and written to the table at the end of each statement execution. Both
statements issued by the client and statements generated by the NonStop ODBC
Server are recorded. A per-statement basis is recommended if the resource
accounting data is to be used to monitor query performance or to identify use patterns.
Statement Handling
Client applications used with the NonStop ODBC Server can contain CORE-SQL
statements, TSQL statements, or SQL/MP statements in pass-through mode. DML
statements are translated to SQL/MP DML statements, and the resource use is
collected by the NonStop ODBC Server.
When a CORE-SQL SELECT statement is executed with the cursor mode set to
READ_ONLY or READ_ONLY_STREAMING, it is executed in a select loop such that,
after the statement is prepared, the cursor is opened, rows are fetched until there is no
more data, then the cursor is closed. The resource usage data is collected at the end
of the session for the SELECT statement.
TSQL batch statements are treated as individual statements, and the resource usage
data is collected per- each statement, for example:
select *from tl
insert into tl values ...
go
The data for the SELECT statement is collected and recorded separately from that for
the INSERT statement.
When a CORE-SQL SELECT statement is executed with the cursor mode set to
FOR_UPDATE, each row is fetched only when the SQL_FETCH statement is invoked.
DML statements such as DELETE or UPDATE WHERE CURRENT OF are allowed
among the SQL_FETCH statements. The resource usage data for each SQL_FETCH
statement and the data generated internally by the OPEN CURSOR statement is
accumulated to produce one set of resource usage data for the SELECT statement.
The resource usage data for the DELETE or UPDATE statement is recorded
separately, for example:
SQL_EXECUTE select * from tl
SQL_FETCH
SQL_FETCH
SQL_EXECUTE delete from tl where current of
SQL_FETCH
SQL_EXECUTE update from tl where current of
In this scenario, three sets of resource usage data are generated. The first set is for
the SELECT statement, consolidating data from the open cursor and all individual