Skip to main content

INFORMATION.SCHEMA.STATEMENTS

Class INFORMATION.SCHEMA.STATEMENTS Extends (%Library.Persistent, %XML.Adaptor) [ ClassType = persistent, Final, Owner = {_PUBLIC}, SqlRowIdPrivate, SqlTableName = STATEMENTS, StorageStrategy = SQLStorage, System = 4 ]

Contains SQL Statement Index entries that can be accessed by the current user in the current namespace.

Parameters

READONLY

Parameter READONLY = 1;

Properties

Hash

Property Hash As %String(MAXLEN = 32) [ Required, SqlColumnNumber = 2 ];

Internal unique statement hash used as the ID for the statement.

SqlComp

Property SqlComp As %String(MAXLEN = 32) [ SqlColumnNumber = 3 ];

SQL Compilation mode, Logical, Odbc, Display, Runtime, etc., when the statement was compiled

DefaultSchema

Property DefaultSchema As %Library.List [ SqlColumnNumber = 4 ];

Value of %defschema when the statement was compiled

SQLSchemaPath

Property SQLSchemaPath As %Library.List [ SqlColumnNumber = 5 ];

Value of %sqlSchemaPath when the statement was compiled

Packages

Property Packages As %Library.List [ SqlColumnNumber = 6 ];

Value of packages argument passed to SQL compiler when the statement was compiled

Switch

Property Switch As %String(MAXLEN = 32) [ SqlColumnNumber = 7 ];

Value of %switch when the statement was compiled

Frozen

Property Frozen As %Integer [ SqlColumnNumber = 8 ];

0/1/2/3 flag which defines if the statement plan Unfrozen (0), Frozen/Explicit (1), Frozen/Upgrade (2), or Unfrozen/Parallel (3)

Timestamp

Property Timestamp As %TimeStamp [ SqlColumnNumber = 9 ];

Timestamp value for when the plan was saved.

Version

Property Version As %String(MAXLEN = 200) [ SqlColumnNumber = 10 ];

$zversion string for when the plan was saved.

Error

Property Error As %String(MAXLEN = 4096) [ SqlColumnNumber = 11 ];

Error string recorded for this plan

Plan

Property Plan As %String(XMLPROJECTION = "NONE") [ Calculated, SqlColumnNumber = 12, SqlComputeCode = { new asl,mt,mts,pdict set {Plan}=$$nlizFromHash^%qaqplan({Hash}) }, SqlComputed ];

Query plan

Statement

Property Statement As %String(COLLATION = "SQLSTRING", MAXLEN = 262144) [ SqlColumnNumber = 13 ];

ParentHash

Property ParentHash As %String(MAXLEN = 32) [ SqlColumnNumber = 14 ];

Hash of this statement's parent statement. Only defined if this is a recursive compile for %PARALLEL statements. This references the root parent's hash.

StatementVersion

Property StatementVersion As %Integer [ Internal, SqlColumnNumber = 15 ];

Version counter for internal statement version

StatCount

Property StatCount As %Integer [ SqlColumnNumber = 16 ];

Total number of times we have recorded this query being run

StatTotal

Property StatTotal As %Double [ SqlColumnNumber = 17 ];

Total time spent running this query

StatVariance

Property StatVariance As %Double [ SqlColumnNumber = 18 ];

Variance in time from running this query

StatFirst

Property StatFirst As %Date [ SqlColumnNumber = 19 ];

First day we recorded statistics from running this query

NaturalQuery

Property NaturalQuery As %Boolean [ SqlColumnNumber = 20 ];

Set to true for 'natural' queries which are already maximally efficient and for which we do not collect any statistics as the overhead of statistical collection would have a significant impact on the statement performance.

StatAverage

Property StatAverage As %Double [ Calculated, SqlColumnNumber = 21, SqlComputeCode = { Set {StatAverage}=$s({StatCount}>0:{StatTotal}/{StatCount},1:"") }, SqlComputed, SqlComputeOnChange = (StatCount, StatTotal) ];

Average time spent running this query

StatStdDev

Property StatStdDev As %Double [ Calculated, SqlColumnNumber = 22, SqlComputeCode = { Set {StatStdDev}={StatVariance}**0.5 }, SqlComputed, SqlComputeOnChange = StatVariance ];

Standard deviation of the time measurement for this query

FrozenDifferent

Property FrozenDifferent As %Boolean [ SqlColumnNumber = 23 ];

True if the frozen plan is different to what we would use if the plan was not frozen

FrozenScanHash

Property FrozenScanHash As %String [ Internal, SqlColumnNumber = 24 ];

Hash when we last scanned this statement to see if the frozen plan is different to the current plan

FrozenScanVersion

Property FrozenScanVersion As %String(MAXLEN = 200) [ Internal, SqlColumnNumber = 25 ];

InterSystems IRIS version from when we last scanned this statement to see if the frozen plan is differnet to the current plan

StatRowCount

Property StatRowCount As %Integer [ SqlColumnNumber = 26 ];

Total %ROWCOUNT from running this query

UserName

Property UserName As %String [ SqlColumnNumber = 27 ];

$username at the time the query was built

ClientName

Property ClientName As %String [ SqlColumnNumber = 28 ];

Client name at the time the query was built

ClientIP

Property ClientIP As %String [ SqlColumnNumber = 29 ];

Client IP address at the time the query was built

ClientApp

Property ClientApp As %String [ SqlColumnNumber = 30 ];

Client application name at the time the query was built

CallStack

Property CallStack As %List [ SqlColumnNumber = 31 ];

Call stack at the time the query was built

StatCommands

Property StatCommands As %Integer [ SqlColumnNumber = 32 ];

Total ObjectScript commands executed from running this query

SQLStatementID

Property SQLStatementID As %Integer [ SqlColumnNumber = 33 ];

A Unique SQL Statement Identifier which can be used to identify each SQL Statement that is stored in the SQL Statement Index (SSI)...

JSONPlan

Property JSONPlan As %String(XMLPROJECTION = "NONE") [ Calculated, SqlColumnNumber = 34, SqlComputeCode = { new asl,mt,mts,pdict set {JSONPlan}=$$nlizFromHash^%qaqplan({Hash},1) }, SqlComputed ];

Machine Readable Query Plan

BinaryPlan

Property BinaryPlan As list Of %Binary(MAXLEN = 65536, XMLNAME = "Plan", XMLPROJECTION = "wrapped") [ Private, SqlColumnNumber = 35, SqlListType = SUBNODE ];

Binary Query plan

Children

Relationship Children As INFORMATION.SCHEMA.STATEMENTCHILDREN [ Cardinality = children, Inverse = Statement ];

Relations

Relationship Relations As INFORMATION.SCHEMA.STATEMENTRELATIONS [ Cardinality = children, Inverse = Statement ];

Locations

Relationship Locations As INFORMATION.SCHEMA.STATEMENTLOCATIONS(XMLPROJECTION = "NONE") [ Cardinality = children, Inverse = Statement ];

PrivilegeRelations

Relationship PrivilegeRelations As INFORMATION.SCHEMA.STATEMENTPRIVOBJECTS [ Cardinality = children, Inverse = Statements ];

Days

Relationship Days As INFORMATION.SCHEMA.STATEMENTDAILYSTATS(XMLPROJECTION = "NONE") [ Cardinality = children, Inverse = Statement ];

Breakdown of light weight SQL stats per day

Methods

GetBinaryPlan

Method GetBinaryPlan(plan) As %Status