MSSQUERYSTATS SAP (Statistical information related to CPU time/memory for query) Structure details
Description: Statistical information related to CPU time/memory for query
Related tables to MSSQUERYSTATS
Access table MSSQUERYSTATS
Structure field list including key, data, relationships and ABAP select examples
MSSQUERYSTATS is a standard SAP Structure so does not store data like a database table does. It can be used to define the fields of other actual tables or to process "Statistical information related to CPU time/memory for query" Information within sap ABAP programs.
This is done by declaring abap internal tables, work areas or database tables based on this Structure. These can then be used to store and process the required data appropriately.
i.e. DATA: wa_MSSQUERYSTATS TYPE MSSQUERYSTATS.
The MSSQUERYSTATS table consists of various fields, each holding specific information or linking keys about Statistical information related to CPU time/memory for query data available in SAP. These include OBJECT_NAME (MS SQL Server object name), EXEC_COUNT (Number of plan executions since last compile), PCT_EXEC_COUNT (Percentage of server total execution counts), TTL_LOGICAL_READS (Total logical reads for this plan since compiled).. See below for full list along with technical details, documentation, text table, check tables, foreign key relationships, conversion routines, relevant tcodes and example ABAP select code etc. .
Delivery Class:Display/Maintenance via tcode SM30: Display/Maintenance Allowed but with Restrictions
SAP enhancement categories: Cannot Be Enhanced
SAP MSSQUERYSTATS structure fields - Full list of fields found in SAP data dictionary
Field | Description | Data Element | Data Type | length (Dec) | Check table | Conversion Routine | Domain Name | MemoryID | SHLP |
SQLHANDLE | handle pointing to sql statment or procedure | MSSSQLHANDLE | CHAR | 130 | MSSHANDLE | ||||
OBJECT_NAME | MS SQL Server object name | MSSOBJNAME | CHAR | 30 | TEXT30 | ||||
EXEC_COUNT | Number of plan executions since last compile | MSSEXECCOUNT | DEC | 20 | |||||
PCT_EXEC_COUNT | Percentage of server total execution counts | MSSPCTEXECCNT | DEC | 5(2) | |||||
TTL_LOGICAL_READS | Total logical reads for this plan since compiled | MSSTTLLOGICALREADS | DEC | 20 | |||||
PCT_LOGICAL_READS | Percent of server wide logical reads | MSSPCTLOGICALREADS | DEC | 5(2) | |||||
AVG_LOGICAL_READS | Average logical reads for this plan since compiled | MSSAVGLOGICALREADS | DEC | 20 | |||||
MAX_LOGICAL_READS | Maximum number of logical reads this plan has ever performed | MSSMAXLOGICALREADS | DEC | 20 | |||||
MIN_LOGICAL_READS | Minimum number of logical reads this plan has ever performed | MSSMINLOGICALREADS | DEC | 20 | |||||
LAST_LOGICAL_READS | Last logical reads for this plan since compiled | MSSLASTLOGICALREADS | DEC | 20 | |||||
TTL_ELAPSED_TIME | Total elapsed time in microseconds | MSSTTLELAPSEDTIME | DEC | 20 | |||||
PCT_ELAPSED_TIME | Percentage of all server elapsed times | MSSPCTELAPSEDTIME | DEC | 5(2) | |||||
AVG_ELAPSED_TIME | Average elapsed time in microseconds | MSSAVGELAPSEDTIME | DEC | 20 | |||||
MAX_ELAPSED_TIME | Maximum elapsed time in microseconds | MSSMAXELAPSEDTIME | DEC | 20 | |||||
MIN_ELAPSED_TIME | Minimum elapsed time in microseconds | MSSMINELAPSEDTIME | DEC | 20 | |||||
LAST_ELAPSED_TIME | Last elapsed time in microseconds | MSSLASTELAPSEDTIME | DEC | 20 | |||||
ET_PER_ROW | Elapsed time in microseconds per row | MSSETPERROW | DEC | 20 | |||||
TTL_CPU_TIME | Total amount of CPU time consumed by executions of this plan | MSSTTLWORKERTIME | DEC | 20 | |||||
PCT_CPU_TIME | Percent of total worker time | MSSPCTWORKERTIME | DEC | 5(2) | |||||
AVG_CPU_TIME | Average amount of CPU time consumed by executions | MSSAVGWORKERTIME | DEC | 20 | |||||
MAX_CPU_TIME | Maximum CPU time consumed by this plan | MSSMAXWORKERTIME | DEC | 20 | |||||
MIN_CPU_TIME | Minimum CPU time consumed by this plan | MSSMINWORKERTIME | DEC | 20 | |||||
LAST_CPU_TIME | CPU time consumed by last execution of this plan | MSSLASTWORKERTIME | DEC | 20 | |||||
TTL_PHYS_READS | Total physical reads for this plan | MSSTTLPHYSREADS | DEC | 20 | |||||
AVG_PHYS_READS | Average physical reads for this plan | MSSAVGPHYSREADS | DEC | 20 | |||||
PCT_PHYS_READS | Percent of all physical reads | MSSPCTPHYSREADS | DEC | 5(2) | |||||
AVG_PHYS_READS | Average physical reads for this plan | MSSAVGPHYSREADS | DEC | 20 | |||||
MAX_PHYS_READS | Maximum number of physical reads for this plan | MSSMAXPHYSREADS | DEC | 20 | |||||
MAX_PHYS_READS | Maximum number of physical reads for this plan | MSSMAXPHYSREADS | DEC | 20 | |||||
MIN_PHYS_READS | Minimum number of physical reads for this plan | MSSMINPHYSREADS | DEC | 20 | |||||
MIN_PHYS_READS | Minimum number of physical reads for this plan | MSSMINPHYSREADS | DEC | 20 | |||||
LAST_PHYS_READS | Physical reads last time this plan executed | MSSLASTPHYSREADS | DEC | 20 | |||||
TTL_LOG_WRITES | Total logical writes for this plan since compiled | MSSTTLLOGWRITES | DEC | 20 | |||||
LAST_PHYS_READS | Physical reads last time this plan executed | MSSLASTPHYSREADS | DEC | 20 | |||||
PCT_LOG_WRITES | Percentage of all logical writes | MSSPCTLOGWRITES | DEC | 5(2) | |||||
TTL_LOG_WRITES | Total logical writes for this plan since compiled | MSSTTLLOGWRITES | DEC | 20 | |||||
AVG_LOG_WRITES | Average logical writes for this plan since compiled | MSSAVGLOGWRITES | DEC | 20 | |||||
PCT_LOG_WRITES | Percentage of all logical writes | MSSPCTLOGWRITES | DEC | 5(2) | |||||
AVG_LOG_WRITES | Average logical writes for this plan since compiled | MSSAVGLOGWRITES | DEC | 20 | |||||
MAX_LOG_WRITES | Maximum logical writes for this plan for a single execution | MSSMAXLOGWRITES | DEC | 20 | |||||
MAX_LOG_WRITES | Maximum logical writes for this plan for a single execution | MSSMAXLOGWRITES | DEC | 20 | |||||
MIN_LOG_WRITES | Minimum logical writes for this plan for a single execution | MSSMINLOGWRITES | DEC | 20 | |||||
MIN_LOG_WRITES | Minimum logical writes for this plan for a single execution | MSSMINLOGWRITES | DEC | 20 | |||||
LAST_LOG_WRITES | Total logical writes for this plan since compiled | MSSLASTLOGWRITES | DEC | 20 | |||||
TTL_CLR_TIME | Total amount of CLR time consumed by executions of this plan | MSSTTLCLRTIME | DEC | 20 | |||||
LAST_LOG_WRITES | Total logical writes for this plan since compiled | MSSLASTLOGWRITES | DEC | 20 | |||||
PCT_CLR_TIME | Percentage of overall CLR time | MSSPCTCLRTIME | DEC | 5(2) | |||||
TTL_CLR_TIME | Total amount of CLR time consumed by executions of this plan | MSSTTLCLRTIME | DEC | 20 | |||||
AVG_CLR_TIME | Average amount of CLR time consumed by this plan | MSSAVGCLRTIME | DEC | 20 | |||||
PCT_CLR_TIME | Percentage of overall CLR time | MSSPCTCLRTIME | DEC | 5(2) | |||||
AVG_CLR_TIME | Average amount of CLR time consumed by this plan | MSSAVGCLRTIME | DEC | 20 | |||||
MAX_CLR_TIME | Maximum CLR time consumed by this plan | MSSMAXCLRTIME | DEC | 20 | |||||
MAX_CLR_TIME | Maximum CLR time consumed by this plan | MSSMAXCLRTIME | DEC | 20 | |||||
MIN_CLR_TIME | Minimum CLR time consumed by this plan | MSSMINCLRTIME | DEC | 20 | |||||
MIN_CLR_TIME | Minimum CLR time consumed by this plan | MSSMINCLRTIME | DEC | 20 | |||||
LAST_CLR_TIME | CLR time consumed by last execution of this plan | MSSLASTCLRTIME | DEC | 20 | |||||
WAIT_FACTOR | Elapsed time/CPU time | MSSWAITFACTOR | DEC | 20 | |||||
LAST_CLR_TIME | CLR time consumed by last execution of this plan | MSSLASTCLRTIME | DEC | 20 | |||||
TTL_ROWS | Total number of rows returned for a query plan | MSSTTLROWS | DEC | 20 | |||||
STMT_START_OFFSET | Start statement offset | MSSSTARTOFFSET | INT4 | 10 | INT4 | ||||
AVG_ROWS | Average rows returned per execution | MSSAVGROWS | DEC | 20 | |||||
STMT_END_OFFSET | Statement end offset | MSSENDOFFSET | INT4 | 10 | INT4 | ||||
SQLTEXT | First 50 characters of a SQL Server statement | MSSPARTIALSQL | CHAR | 50 | TEXT50 | ||||
MAX_ROWS | Maximun number of rows returned for a query plan | MSSMAXQROWS | DEC | 20 | |||||
MIN_ROWS | Minimum number of rows returned for a query plan | MSSMINQROWS | DEC | 20 | |||||
ABAP_NAME | Name of the ABAP report | MSSABNAME | CHAR | 40 | PROGNAME | ||||
ABAP_LOC | Offset of a Processing Control Block | ABP_CONT | INT4 | 10 | |||||
LAST_ROWS | Total number of rows returned for a query plan | MSSLASTROWS | DEC | 20 | |||||
WAIT_FACTOR | Elapsed time/CPU time | MSSWAITFACTOR | DEC | 20 | |||||
PLAN_GEN_NUM | Number of times this plan has been recompiled | MSSPLANGENNUM | DEC | 20 | |||||
PLAN_HANDLE | handle pointing to plan used in execution of sql stmt/proc | MSSPLANHANDLE | CHAR | 130 | MSSHANDLE | ||||
EXECS_PER_HOUR | Executions per hour | MSSEXECSPH | DEC | 16(3) | |||||
CREATION_TIME | MS SQL Server time at which the plan was compiled. | MSSPLANCRETIME | CHAR | 20 | TEXT20 | ||||
STMT_START_OFFSET | Start statement offset | MSSSTARTOFFSET | INT4 | 10 | INT4 | ||||
LAST_EXEC_TIME | MS SQL Server: Last time at which the plan was executed. | MSSPLANEXECTIME | CHAR | 20 | TEXT20 | ||||
STMT_END_OFFSET | Statement end offset | MSSENDOFFSET | INT4 | 10 | INT4 | ||||
SQLTEXT | First 50 characters of a SQL Server statement | MSSPARTIALSQL | CHAR | 50 | TEXT50 | ||||
ABAP_NAME | Name of the ABAP report | MSSABNAME | CHAR | 40 | PROGNAME | ||||
ABAP_LOC | Offset of a Processing Control Block | ABP_CONT | INT4 | 10 | |||||
PLAN_GEN_NUM | Number of times this plan has been recompiled | MSSPLANGENNUM | DEC | 20 | |||||
PLAN_HANDLE | handle pointing to plan used in execution of sql stmt/proc | MSSPLANHANDLE | CHAR | 130 | MSSHANDLE | ||||
CREATION_TIME | MS SQL Server time at which the plan was compiled. | MSSPLANCRETIME | CHAR | 20 | TEXT20 | ||||
LAST_EXEC_TIME | MS SQL Server: Last time at which the plan was executed. | MSSPLANEXECTIME | CHAR | 20 | TEXT20 | ||||
TABLE_LIST | Comma separated table list | MSSCSTABLIST | CHAR | 1000 |
Key field | Non-key field |
How do I retrieve data from SAP structure MSSQUERYSTATS using ABAP code?
As MSSQUERYSTATS is a database structure and not a table it does not store any data in the SAP data dictionary. The ABAP SELECT statement is therefore not appropriate and can not be performed on MSSQUERYSTATS as there is no data to select.How to access SAP table MSSQUERYSTATS
Within an ECC or HANA version of SAP you can also view further information about MSSQUERYSTATS and the data within it using relevant transactions such asSE11 (ABAP Dictionary Maintenance)
SM30 (Maintain Table Data)
SE80 (Object Navigator)
SE16 (Data Browser).
Search for further information about these or an SAP related objects