matrixmgr extension

This document introduces the main components and functions of the matrixmgr extension.

matrixmgr extends mainly for YMatrix's query statistics function. After the YMatrix cluster is initialized, the matrixmgr database and matrixmgr extension will be created by default. After the deployment is successful, the following tables and views will appear in the matrixmgr_internal mode of the matrixmgr database:

View Description
mxstat_execute This view provides the execution of SQL statements, such as node instances of SQL statements, users, query text, the longest and shortest time to execute, and the time stamps of each stage of the slowest statement. You can use this table to see the execution time of SQL statements and analyze the slowest statements
mxstat_usage This view provides the consumption of computing resources when SQL statements are executed
mx_query_execute_history This view is the historical information of the mxstat_execute view
mx_query_usage_history This view is the historical information of the mxstat_usage view
mx_querytext This view stores a mapping of queryid and querytext, through which you can get SQL text
mx_query_execute_history_with_text Views after associating mx_query_execute_history with mx_querytext via queryid

Enter the matrixmgr database to view the following views:

mxstat_execute

This view shows query statistics in 5 minutes.

Field Name Type Description
seg integer Query generate and issue plan node number
userid oid user OID
dbid oid database OID
queryid bigint query ID, generated by extension, is used to classify queries of the same type
nestlevel integer nestlevel depth
query text query text
calls_begin bigint query start times
calls_alive bigint The number of queries in execution state when historical information was collected last time
calls_end bigint The number of normal query ends
total_time double precision total execution time of this query, in milliseconds
min_time double precision The minimum execution time of this type of query, in milliseconds
max_time double precision maximum execution time of this type of query, in milliseconds
mean_time double precision average execution time of this type of query, in milliseconds
stddev_time double precision Standard deviation of execution time of this type of query, in milliseconds
sample_planid bigint execution plan ID
sample_start timestamp with time zone Slowest query startup timestamp
sample_parse_done timestamp with time zone Slowest query completion parsing timestamp
sample_plan_done timestamp with time zone Slowest query generates plan timestamp
sample_exec_start timestamp with time zone Slowest query starts executing timestamp
sample_exec_end timestamp with time zone The slowest query execution time stamp

mxstat_usage

This view shows query resource consumption information within 5 minutes.

Field Name Type Description
seg integer query execution node number
userid oid user OID
dbid oid database OID
queryid bigint query ID, generated by extension, is used to classify queries of the same type
nestlevel integer nestlevel depth
rows bigint Total number of rows retrieved or affected by this statement
shared_blks_hit bigint Total number of shared block buffer hits caused by this statement
shared_blks_read bigint Total number of shared blocks read by this statement
shared_blks_dirtied bigint Total number of shared blocks stained by this statement
shared_blks_writen bigint Total number of shared blocks written by this statement
local_blks_hit bigint Total number of buffer hits caused by this statement
local_blks_read bigint total number of local parcels read by this statement
local_blks_dirtied bigint Total number of local parcels stained by this statement
local_blks_writen bigint Total number of local parcels written by this statement
temp_blks_read bigint Total number of temporary blocks read by this statement
temp_blks_writen bigint Total number of temporary blocks written by this statement
blk_read_time double precision The total time this statement takes to read a block, in milliseconds
blk_write_time double precision The total time this statement takes to write to a block, in milliseconds
ru_utime double precision User status CPU time
ru_stime double precision System state CPU time
ru_maxrss bigint Actual use of physical memory, including memory occupied by shared libraries, unit KB
ru_ixrss bigint Integrated shared memory size
ru_idrss bigint Integrated non-shared data size
ru_isrss bigint Integrated non-shared stack size
ru_minflt bigint Number of page-missing interrupts, and no I/O is required to process these interrupts
ru_majflt bigint Number of page-missing interrupts, and I/O is required to process these interrupts
ru_nswap bigint swap space
ru_inblock bigint Number of times the file system needs to perform input operations
ru_oublock bigint Number of times the file system needs to perform output operations
ru_msgsnd bigint Number of messages sent
ru_msgrcv bigint Number of messages received
ru_signals bigint Number of received signals
ru_nvcsw bigint Number of context switches caused by a process voluntarily giving up the processor time slice
ru_nivcsw bigint Number of context switches caused by process time slices being used or being intercepted by high priority processes

Other views

  • mx_query_execute_history: This view is a partitioned view, which is a collection of historical information for the mxstat_execute view, and the default is 5 every min. Its structure is consistent with the mxstat_execute view, except that there is an additional ts_bucket field to record the collection time point.
  • mx_query_usage_history: This view is a partitioned view, which is a historical information collection of mxstat_usage view, and the default is 5 every min. Its structure is consistent with the mxstat_usage view, except that there is an additional ts_bucket field to record the collection time point.
  • mx_querytext: Stores the mapping of queryid and querytext, like other historical information collection tables, periodically stored, with the purpose of making history queries get SQL text.
  • mx_query_execute_history_with_text: View after associating mx_query_execute_history with mx_querytext via queryid. Read historical query statistics and SQL text at the same time.

See also

Query Statistics