monSysStatement

Description

Provides a history of the most recently executed statements on the server. Use statement pipe max messages to tune the maximum number of statement statistics returned.

Enable the enable monitoring, statement statistics active, per object statistics active, statement pipe max messages, and statement pipe active configuration parameters for this monitoring table to collect data.

monSysStatement is a historical monitoring table. See Performance and Tuning: Monitoring Tables.

Columns

The columns for monSysStatements are:

Name

Datatype

Attributes

Description

SPID

smallint

Session process identifier.

InstanceID

int

(Cluster environments only) ID of an instance in a shared-disk cluster.

KPID

int

Kernel process identifier.

DBID

int

Unique identifier for the database.

ProcedureID

int

Unique identifier for the procedure.

PlanID

int

Unique identifier for the stored plan for the procedure.

BatchID

int

Unique identifier for the SQL batch containing the statement.

ContextID

int

The stack frame of the procedure, if a procedure.

LineNumber

int

Line number of the statement within the SQL batch.

CpuTime

int

Counter

Number of milliseconds of CPU used by the statement.

WaitTime

int

Counter

Number of milliseconds the task has waited during execution of the statement.

MemUsageKB

int

Number of kilobytes of memory used for execution of the statement.

PhysicalReads

int

Counter

Number of buffers read from disk.

LogicalReads

int

Counter

Number of buffers read from cache.

PagesModified

int

Counter

Number of pages modified by the statement.

PacketsSent

int

Counter

Number of network packets sent by Adaptive Server.

PacketsReceived

int

Counter

Number of network packets received by Adaptive Server.

NetworkPacketSize

int

Size (in bytes) of the network packet currently configured for the session.

PlansAltered

int

Counter

The number of plans altered at execution time.

RowsAffected

int

Number of rows affected by the current statement. Queries using an inefficient query plan likely show a high number of logical I/Os per returned row.

ErrorStatus

int

The error return status of the statement.

HashKey

int

Hash value for the text of the statement; this is not a unique identifier. This column is zero (0) if the statement is not executed from the statement cache.

SsqlId

int

ID of the query plan for this statement within the statement cache. This column is zero (0) if the statement is not executed from the statement cache.

ProcNestLevel

int

Nesting level of the statement. This column is zero (0) if the statement is an ad hoc query. If the statement is within a stored procedure, this column indicates the nesting level of that stored procedure.

StatementNumber

int

Number indicating the order in which this statement was executed within the SQL batch for the process.

DBName

varchar(30)

Name of the database inwhich the statement is executed. This column is NULL if the database is no longer open when monSysStatement is queried. If the process is executing a stored procedure or other compiled object, the database name is the name of the database for that object.

StartTime

datetime

Null

Date the statement began execution.

EndTime

datetime

Null

Date the statement finished execution.