GreenPlum中的gpmetrics Schema下的系统表介绍

0    328    1

Tags:

👉 本文共约27613个字,系统预计阅读时间或需104分钟。

简介

Greenplum Command Center creates the gpmetrics schema in the Vmware Greenplum gpperfmon to save alert rules and logs, and historical metrics collected by the VMware Greenplum metrics collection system. The gpmetrics schema contains the following tables and user-defined functions:

Tables

User-Defined Functions

If you set the schema search path to include the gpmetrics schema, you do not have to qualify table and user-defined function names with the gpmetrics schema name. To set the default search path for the gpperfmon database enter this SQL command.

You must exit the current session and start a new session for the new search path to take effect.

Alert Tables

Command Center uses the gpcc_alert_rule and gpcc_alert_log tables to store the alert rules you set up in the user interface and to log messages when the alert rules are triggered.

gpcc_alert_rule

Note: Deprecated in Command Center 6.4/4.12.

The gpcc_alert_rule table records the alert rules configured in the Command Center user interface. It has the columns shown in the following table.

ColumnTypeDescription
rule_idintegerUnique id for the rule.
rule_typeintegerReserved for future use.
rule_descriptioncharacter varying(512)Text of the rule.
rule_configjsonJSON string containing parameters for user-specified values.
ctimetimestamp(0) without time zoneTime the rule was created.
etimetimestamp(0) without time zoneTime the rule became inactive, or null if rule is active.

The gpcc_alert_rule table keeps a history of alert rule configurations. When a rule becomes active, a new row is inserted and the ctime timestamp column is set to the current time; the etime timestamp is null, indicating that the rule is still active. When a rule is either disabled or superceded by a new rule, the etime timestamp column is set to the current time. Thus, the set of currently active rules is all rows where the etime column is null. A row that has timestamps in both ctime and etime columns is an historical record of the period of time during which the rule was active.

The rule_id column, a unique integer, is the distribution key for the table and is used to identify a single alert rule configuration. This column can be joined with the rule_id column in the gpcc_alert_log table to identify the rule that triggered each recorded alert event.

The rule_description column contains a string that describes the event that matches the rule. It is the text displayed in the Command Center UI for the rule, with user-specified values inserted.

The rule_config column contains a JSON string with parameters for the values entered for each of the rule’s fields in the Command Center UI.

gpcc_alert_history

The gpcc_alert_history table (wasgpcc_alert_log before Command Center 6.4) has the following columns:

ColumnTypeDescription
idintegerUnique ID for the alert.
rule_idintegerThe ID of the rule that triggered this alert.
transaction_timetimestamp(0) without time zoneTime the alert was raised.
contentjsonContains parameters specifying values that triggered the alert.
configjsonStores alert history from emails or notifications.

Where:

  • The id column, a unique integer, is the distribution key for the table.
  • The transaction_time column is set to the current time when a row is created.
  • The rule_id column can be joined with the rule_id column in the gpcc_alert_rule table to access details of the rule that triggered the alert.
  • The content column contains a JSON string with parameters specifying details about the event that triggered the alert. The JSON parameters vary with the type of the alert.
  • The config column stores the alert history received from the notification center or from emails.

The gpcc_alert_history table is an append-only, column-oriented table, partitioned by month on the transaction_time column. Command Center creates new partitions as needed and removes partitions over 12 months old.

A row is added to the gpcc_alert_history table whenever an alert rule is matched.

VMware Greenplum Metrics History Tables

The gpmetrics query history saves information collected by the Greenplum Database metrics collection system and forwarded to Greenplum Command Center.

The distribution key for each table is a ctime timestamp column, which is the time when the row is added to the database. The tables are partitioned by year and month, except for gpcc_queries_history and gpcc_plannode_history which are partitioned by day for optimal performance. Greenplum Command Center creates new partitions automatically as needed.

The history tables use append-optimized, column-oriented storage.

Command Center only saves queries with runtimes greater than the value of the min_query_time configuration parameter, found in the $HOME/gpmetrics/gpcc.conf configuration file on the host executing Command Center. The default, 0, saves all queries in the history table. This parameter can be configured on the Command Center Admin> Settings page.

gpcc_database_history

The gpcc_database_history table saves summary query activity metrics collected by the VMware Greenplum metrics collector. This data can be used to review the VMware Greenplum query load over time.

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime the record was created.
queries_totalintegerTotal number of queries running and queued to run.
queries_runningintegerNumber of queries currently running.
queries_queuedintegerNumber of queries queued, but not yet running.
queries_blockedintegerThe number of queries started, but blocked by other transactions.
queries_finishedintegerThe number of queries that completed since the previous sampling interval.

gpcc_disk_history

The gpcc_disk_history table saves historical disk usage statistics for each VMware Greenplum segment host file system.

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime the row was created.
hostnamecharacter varying(64)Name of the segment host.
filesystemtextPath to the segment’s data directory.
total_bytesbigintTotal size of the file system storage in bytes.
bytes_usedbigintNumber of storage bytes in
bytes_availablebigintNumber of storage bytes available.

gpcc_export_log

The gpcc_export_log table saves the log notifications from every “EXPORT ALL” user action. Whenever the user exports search results from the History or the Table Browser pages, this table gets updated.

ColumnTypeModifiers
idintegernot null default nextval(‘gpcc_export_log_id_seq’::regclass)
ctimetimestamp(0) with time zonenot null default now()
sourcecharacter varying(64)not null
filenamecharacter varying(64)not null
rolenamenot null
req_paramsjsonnot null
etimetimestamp(0) with time zone
statuscharacter varying(64)
fail_msgtext

gpcc_index_info

Command Center uses the gpcc_index_info table to store information about table indices’ size, particularly their bloat size. This information is used to report when reindexing is recommended for a table.

ColumnTypeDescription
dbidOIDThe id of the table’s database; this value is related to the pg_database OID.
databasevarchar(64)The table’s database.
schemavarchar(64)The table’s schema.
table_oidOIDThe table’s OID.
relation_namevarchar(64)The table’s name.
index_oidOIDThe OID of the table’s index.
index_namevarchar(64)The name of the table’s index.
real_sizebigintThe actual size of the index.
extra_sizebigintThe estimated extra size not used or needed by the index. This extra size is composed of the fillfactor, bloat, and alignment padding spaces.
fillfactorintThe fillfactor of the index.
index_bloat_spacebigintThe estimated size of the bloat without the extra space set aside for the fillfactor.
index_bloat_ratebigintThe estimated percentage of the real size used by the index bloat space.
is_nabooleanIf true, then the index bloat recorded by that row is “not accurate” and that index will not be included in the REINDEX recommendation.
latest_scan_tstimestamp with timezoneThe time of the last scan.
last_reindexedtimestamp with timezoneThe time of the last reindexing.

gpcc_pg_log_history

The gpcc_pg_log_history table stores pg_log errors and warnings from the Greenplum Server log files.

ColumnTypeDescription
logtimetimestamp without time zoneTimestamp for this log.
logusertextName of the role executing the query.
logdatabasetextThe database accessed.
logpidtextProcess id.
logthreadtextThread number.
loghosttextHost name or IP address of the host.
logporttextPort number.
logsessiontimetimestamp without time zoneSession timestamp.
logtransactionintegerTransaction id.
logsessiontextSession id.
logcmdcounttextCommand count.
logsegmenttextSegment number.
logslicetextSlice number.
logdistxacttextDistributed transation id.
loglocalxacttextLocation transacton id.
logsubxacttextSubtransaction id.
logseveritytextLog severity.
logstatetextSQL State code associated with this log message.
logmessagetextLog or error message text.
logdetailtextDetail message text associated with an error message.
loghinttextHint message text associated with an error message.
logquerytextInternally-generated query text.
logqueryposintegerIndex into the internally-generated query text.
logcontexttextContext in which this message gets generated.
logdebugtextQuery string with full detail for debugging.
logcursorposintegerCursor index into the query string.
logfunctiontextFunction in which this message is generated.
logfiletextLog file in which this message is generated.
loglineintegerLine in the log file in which this message is generated.
logstacktextFull text of the stack trace associated with this message.

gpcc_plannode_history

The gpcc_plannode_history table saves detailed metrics for each operation (node) in a completed query plan. Each row contains metrics for one operation that executed on one VMware Greenplum segment. This information allows reconstructing the plan and execution metrics for a completed query.

Plan node history is only saved for queries that execute for 10 seconds or more.

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime the row was created.
tmidintegerA time identifier for the query. All records associated with a query will have the same tmid.
ssidintegerSession id for the database connection. All records associated with the query will have the same ssid.
ccntintegerCommand number within the session. All records associated with the query will have the same ccnt.
segidintegerId (dbid) of the segment for this plan node.
procidintegerThe postgres process ID for this plan node.
sliceidintegerDEPRECATED. I̶d̶ o̶f̶ t̶h̶e̶ s̶l̶i̶c̶e̶ t̶h̶e̶ o̶p̶e̶r̶a̶t̶i̶o̶n̶ b̶e̶l̶o̶n̶g̶s̶ t̶o̶.̶ O̶p̶e̶r̶a̶t̶i̶o̶n̶s̶ t̶h̶a̶t̶ b̶e̶l̶o̶n̶g̶ t̶o̶ t̶h̶e̶ s̶a̶m̶e̶ s̶l̶i̶c̶e̶ e̶x̶e̶c̶u̶t̶e̶ i̶n̶ p̶a̶r̶a̶l̶l̶e̶l̶.̶
nodeidintegerThe query plan node ID for this operation.
parent_nodeidintegerThe parent query plan node ID from the query plan.
node_typecharacter varying(64)Name of the operation type.
tinittimestamp(6) without time zoneTime the operation was initialized.
tstarttimestamp(6) without time zoneTime the operation started.
tfinishtimestamp(6) without time zoneTime the operation finished.
statuscharacter varying(16)Status of the operation: initialize, executing, or finished.
planrowsdouble precisionThe number of output rows estimated for the operation.
planwidthintegerWidth of output rows estimated for the operation.
start_costdouble precisionNumber of page reads expected to produce first output row.
total_costdouble precisionNumber of page reads expected to produce all output rows.
tuple_countbigint
ntuplesbigint
nloopsbigint
first_tupletimestamp(6) without time zoneTime the operation produced the first output row.
rel_oidoidObject ID of the output rows produced by the operation.
relation_namecharacter varying(64)Name of the table this operation processed, if any.
index_namecharacter varying(64)Name of the index used by this operation, if any.
alias_namecharacter varying(64)Alias for the relation declared in the SQL command.
node_seqintegerNode sequence
conditiontextCondition expression used for a filter or join operation.

gpcc_ps_history

The gpcc_ps_history table saves the output of ps aux --sort=vsz from each host at intervals of every five minutes.

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime at which the data was sampled.
hostnamecharacter varying(64)Hostname from which the data was sampled.
usernamecharacter varying(64)User who owns the associated process.
pidintegerID of the associated process.
cpu_percentdouble precisionPercentage of CPU time used by the process divided by its total runtime.
mem_percentdouble precisionRatio of the process’s resident set size to the total physical memory of the machine.
vszbigintVirtual memory usage of the entire process in kilobytes (KiB).
rssbigintResident set size, the non-swapped physical memory used by the process in kilobytes (KiB).
ttycharacter varying(64)Controlling terminal (tty).
statcharacter varying(64)Current process state.
startcharacter varying(64)Start time or date of the associated process.
timecharacter varying(64)Cumulative CPU time consumed by the process.
commandcharacter varying(1024)Full command executed by the process along with its arguments.

gpcc_queries_history

The gpcc_queries_history table saves metrics for completed queries.

ColumnTypeDescription
access_tables_infointegerThe table OID of the query accessed.
ctimetimestamp(0) without time zoneTime the row was created.
tmidintegerA time identifier for the query. All records associated with the query will have the same tmid.
ssidintegerSession id for the database connection. All records associated with the query will have the same ssid.
ccntintegerCommand number within this session. All records associated with the query will have the same ccnt.
usernamecharacter varying(64)Role name that issued the query.
dbcharacter varying(64)Name of the database queried.
costdouble precisionEstimated cost to execute query, computed by the legacy planner or GPORCA.
tsubmittimestamp(6) without time zoneTime the query was submitted.
tstarttimestamp(6) without time zoneTime the query was started.
tfinishtimestamp(6) without time zoneTime the query finished.
statuscharacter varying(16)Status of the query – abort, error, or done.
rows_outbigintNumber of rows returned by the query.
error_msgtextError message, if the query failed.
plan_gencharacter varying(16)PLANNER if query plan was generated by the legacy planner; OPTIMIZER if the plan was generated by GPORCA, the Greenplum query optimizer.
query_hashcharacter varying(64)Hash code generated from the text of the query.
query_texttextComplete text of the query. Some queries may be reformatted before storing in the history database.
application_namecharacter varying(64)Name of the client application that established the database connection.
rsqnamecharacter varying(64)If the gp_resource_manager configuration parameter is queue, the name of the resource queue managing the query.
rsgnamecharacter varying(64)If the gp_resource_manager configuration parameter is group, the name of the resource group managing the query.
cpu_masterbigintTotal CPU usage for this query on the VMware Greenplum coordinator instance.
cpu_segsbigintTotal CPU usage for this query across all segments, measured in seconds. This is the sum of the CPU usage values taken from all active primary segments in the database array.
cpu_master_percentdouble precisionAverage CPU percent usage on the coordinator host during execution of this query.
cpu_segs_percentdouble precisionAverage CPU percent usage on the segment hosts during the execution of this query.
skew_cpudouble precisionDisplays the amount of processing skew in the system for this query. Processing/CPU skew occurs when one segment performs a disproportionate amount of processing for a query. The skew is calculated from total CPU seconds used on all segments during the execution of the query.
skew_rowsdouble precisionDisplays the amount of row skew in the system. Row skew occurs when one segment produces a disproportionate number of rows for a query.
memorybigintTotal size of memory, in kilobytes, used by all segments to execute this query.
disk_read_bytesbigintNumber of bytes read from disk.
disk_write_bytesbigintNumber of bytes written to disk.
spill_sizebigintTotal size, in bytes, of spill files used by all segments to execute this query.
rqprioritycharacter varying(16)Priority setting for the resource queue managing this query. Blank if resource group management is enabled.
query_tagtextA key-value pair describing a query.
slices_metricsJSONThe cpu/memory/disk metrics for a slice.
peak_memorybigintMaximum memory usage across all segments during the execution of the query, measured in KB.
node_sliceidjsonA map of node ID to slice ID.
lock_secondssecondsThe number of seconds the query has been blocked.

gpcc_resgroup_history

The gpcc_resgroup_history table saves the history of the resource consumption of each resource group on each segment.

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime the row was created.
rsgnamenameResource group name.
host_nametextThe host name of the segment.
groupidoidObject ID of the resource group.
concurrency_limitintegerThe concurrency (CONCURRENCY) value specified for the resource group.
num_runningintegerThe number of transactions currently executing in the resource group.
num_queueingintegerThe number of currently queued transactions for the resource group.
cpu_max_percentintegerThe CPU limit (CPU_MAX_PERCENT value) configured for the resource group, or -1.
cpu_weightintegerThe scheduling priority (CPU_WEIGHT value) configured for the resource group.
memory_limitintegerThe memory limit (MEMORY_LIMIT value) configured for the resource group, in MB.
cpu_usagenumericThe percentage of CPU resources used on the segment host.
memory_usagenumericThe memory used on the segment host, in MB.

gpcc_scan_history

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime the row was created.
scan_idintegerScan id for this scan. See schedule_id column in the gpcc_schedule.
statusintegerScan completion status. 0=Running, 1=Success, 2=Failed, 3=Cancelled, 4=Expired.
tables_scannedbigintThe number of tables that were scanned.
start_dttimestamp(0) without time zoneTime the scan began.
end_dttimestamp(0) without time zoneTime the scan ended.

gpcc_schedule

The gpcc_schedule table contains details for scheduled events, such as the table scan for Recommendations. Each row describes a schedule in a JSON value. The ctime and etime columns together specify the period of time during which the schedule is enabled.

ColumnTypeDescription
schedule_idintegerId number for this schedule.
descriptioncharacter varying(512)Description of schedule.
schedule_configjsonJSON string with schedule details.
ctimetimestamp(0) without time zoneTime the schedule was added and enabled.
etimetimestamp(0) without time zoneTime the schedule was disabled.

gpcc_system_history

The gpcc_system_history table saves historical system metrics for each VMware Greenplum host, including the coordinator, standby coordinator, and segment hosts. The metrics include information about memory, CPU, disk, and network utilitization.

ColumnTypeDescription
cpu_iowaitdouble precisionThe percentage of CPU used waiting on IO requests.
ctimetimestamp(0) without time zoneTime the row was created.
hostnamecharacter varying(64)Segment or coordinator hostname associated with these system metrics.
mem_totalbigintTotal system memory in Bytes for this host.
mem_usedbigintSystem memory used, in Bytes, for this host.
mem_cachedbigintActual memory used, in Bytes, for this host (not including the memory reserved for cache and buffers).
mem_bufferedbigintFree actual memory, in Bytes, for this host (not including the memory reserved for cache and buffers).
swap_totalbigintTotal swap space in Bytes for this host.
swap_usedbigintSwap space used, in Bytes, for this host.
swap_page_inbigintNumber of swap pages in.
swap_page_outbigintNumber of swap pages out.
cpu_userdouble precisionPercentage of time CPU processes execute in user mode.
cpu_sysdouble precisionPercentage of time CPU processes execute in system (kernel) mode.
cpu_idledouble precisionPercentage idle CPU.
load0double precisionCPU one-minute load average.
load1double precisionCPU five-minute load average.
load2double precisionCPU fifteen-minute load average.
quantumsecondsInterval between metrics collections.
disk_ro_ratebigintDisk read operations per second.
disk_wo_ratebigintDisk write operations per second.
disk_rb_ratebigintBytes per second for disk read operations.
disk_wb_ratebigintBytes per second for disk write operations.
min_free_kbyteskilobyteThe minimum amount of free memory that the kernel’s memory manager keeps on a host machine.
net_rp_ratebigintPackets per second on the system network for read operations.
net_wp_ratebigintPackets per second on the system network for write operations.
net_rb_ratebigintBytes per second on the system network for read operations.
net_wb_ratebigintBytes per second on the system network for write operations.
kswapd_pgstealbigintThe sum of pgsteal_kswapd* entries found in the /proc/vmstat file.
kswapd_hit_lwmarkbigintThe value of kswapd_low_wmark_hit_quickly recorded in the /proc/vmstat file.

gpcc_table_info

The gpcc_table_info table stores a current snapshot of statistics for tables. There is one row for each table and partition.

ColumnTypeDescription
ctimetimestamp without time zoneTime the row was created.
dbidoidObject ID of the database.
relidoidObject ID of the table.
paroidoidObject ID of a partition.
reltablespaceoidObject ID of the table’s tablespace.
seq_scanbigintNumber of sequential scans initiated on this table.
idx_scanbigintNumber of index scans initiated on this table.
n_tup_insbigintNumber of rows inserted.
n_tup_delbigintNumber of rows deleted.
n_tup_updbigintNumber of rows updated (includes hot updated rows).
n_tup_hot_updbigintNumber of rows HOT updated (no separate index update required).
last_seq_scantimestamp with time zoneTime of the last sequential scan on this table. An ANALYZE on a table can cause a sequential scan and update the count in the seq_scan column. However, the time of that scan is not saved in this column.
last_idx_scantimestamp with time zoneTime of the last index scan on this table.
last_instimestamp with time zoneTime of the last insert on this table.
last_deltimestamp with time zoneTime of the last delete on this table.
last_updtimestamp with time zoneTime of the last update on this table.
last_analyzetimestamp with time zoneTime of the last analyze on this table.
last_vacuumtimestamp with time zoneTime of the last vacuum of this table (excludes vacuum full).
last_vacuum_fulltimestamp with time zoneTime of the last vacuum full or last vacuum full freeze of this table.
sizebigintCombined size of the table’s files on all segments. Note that for partitioned tables, the sizes of individual partitions are not included.
row_cntrealNumber of rows in the table.
childrenintegerNumber of partitions, including middle-level and child partitions.
schemanameName of the schema this table belongs to.
table_namenameName of the table.
ownernameName of the database role that owns this table.
relstoragecharacter(1)Storage mode of this table. a=append-optimized, c=column-oriented, h =heap, v = virtual, x= external table.
relkindcharacter(1)The type of object: r = heap or append-optimized table.
bloatrealCalculated bloat for the table when last scanned.
scan_sizebigintSize of table when last scanned.
unusedrealUnused.
skewrealCalculated skew for the table when last scanned.
last_scan_rowcntrealNumber of rows in the table when last scanned.
last_scan_tstimestamp with time zoneTime the table was last scanned for Recommendations.
accuracyrealAccuracy ratio calculated from query history when the table was last scanned.
last_accuracy_tstimestamp with time zoneTime the accuracy ratio was last set.
distributed_bytextDistribution policy for the table.
age_percentfloatTracks information for calculating when a table should have vacuum freeze run on it. It stores what percentage of the xid_warn_limit GUC the table’s age is. For example, if a table’s age is 70% of xid_warn_limit, its age_percent is stored as 0.7.
last_vacuum_freezetimestamp with time zoneRecords the last time that one of vacuum full, vacuum freeze or vacuum full freeze was performed on the table.
last_size_tstimestamp with time zoneTime when the current table’s size column was last updated.

gpcc_table_info_history

The gpcc_table_info_history table stores a daily snapshot of statistics about tables. Command Center saves statistics from the gpcc_table_info table at 3:00 a.m. each morning. There is one row for each table per day.

ColumnTypeDescription
ctimetimestamp(0) without time zoneTime the record was created.
dbidoidObject ID of the database.
relidoidObject ID of the table.
paroidoidObject ID of a partition.
reltablespaceoidObject ID of the table’s tablespace.
seq_scanbigintNumber of sequential scans initiated on this table.
idx_scanbigintNumber of index scans initiated on this table.
n_tup_insbigintNumber of rows inserted.
n_tup_delbigintNumber of rows deleted.
n_tup_updbigintNumber of rows updated (includes hot updated rows).
n_tup_hot_updbigintNumber of rows HOT updated (no separate index update required).
last_seq_scantimestamp with time zoneTime of the last sequential scan on this table.
last_idx_scantimestamp with time zoneTime of the last index scan on this table.
last_instimestamp with time zoneTime of the last insert on this table.
last_deltimestamp with time zoneTime of the last delete on this table.
last_updtimestamp with time zoneTime of the last update on this table.
last_analyzetimestamp with time zoneTime of the last analyze on this table.
last_vacuumtimestamp with time zoneTime of the last vacuum of this table (excludes vacuum full).
last_vacuum_fulltimestamp with time zoneTime of the last vacuum full of this table.
sizebigintCombined size of the table’s files on all segments. Note that for partitioned tables, the sizes of individual partitions are not included.
row_cntrealNumber of rows in the table.
childrenintegerNumber of partitions, including middle-level and child partitions.
schemanameName of the schema this table belongs to.
table_namenameName of the table.
ownernameName of the database role that owns this table.
relstoragecharacter(1)Storage mode of this table. a=append-optimized, c=column-oriented, h = heap, v = virtual, x= external table.
relkindcharacter(1)The type of object: r = heap or append-optimized table.
bloatrealCalculated bloat for the table when last scanned.
scan_sizebigintSize of the table when last scanned.
unusedreal
skewrealCalculated skew for the table when last scanned.
last_scan_rowcntrealNumber of rows in the table when last scanned.
last_scan_tstimestamp with time zoneTime the table was last scanned for Recommendations.
accuracyrealAccuracy ratio calculated from query history when the table was last scanned.
last_accuracy_tstimestamp with time zoneTime the accuracy ratio was last set.
distributed_bytextDistribution policy for the table.
age_percentfloatTracks information for calculating when a table should have VACUUM FREEZE run on it. It stores what percentage of the xid_warn_limit GUC the table’s age is. For example, if a table’s age is 70% of xid_warn_limit, its age_percent is stored as 0.7
last_vacuum_freezetimestamp with time zoneRecords the last time that one of VACUUM FULL, VACUUM FREEZE or VACUUM FULL FREEZE was performed on the table.
last_size_tstimestamp with time zoneTime when the current table’s size column was last updated.

Real-Time Monitoring Tables

gpcc_queries_now

The gpcc_queries_now table saves real-time query metrics data.

ColumnTypeDescription
tmidintegerA part of the query ID.
ssidintegerSession ID of the query.
ccntintegerA part of the query ID.
usernamecharacter varying(64)User name.
dbcharacter varying(64)Database.
statuscharacter varying(16)Query status.
rsgnamecharacter varying(64)Resource group name.
rsqnamecharacter varying(64)Resource queue name.
rsqprioritycharacter varying(16)Resource queue priority.
tsubmittimestamp(0) without time zoneSubmit time.
tstarttimestamp(0) without time zoneStart time.
cpu_timedouble precisionCPU time accumulated (unit: seconds).
cpu_masterdouble precisionCPU time on coordinator.
cpu_segmentdouble precisionCPU time on all segemnts.
cpu_master_percentdouble precisionCPU percent on coordinator.
cpu_segment_percentdouble precisionCPU percent on all segments.
spill_sizebigintSpill file size (bytes)
memorybigintMemory (KB)
disk_read_ratedouble precisionCurrent disk read rate (KB/s).
disk_write_ratedouble precisionCurrent disk write rate (KB/s).
disk_read_bytesbigintCurrent disk read bytes (bytes).
disk_write_bytesbigintCurrent disk write bytes (bytes).
skew_cpudouble precisionCPU skew.
plan_gencharacter varying(16)Plan generator for the query.
costdouble precisionQuery cost.
query_texttextQuery text.

Workload Management Tables

gpcc_wlm_rule

The gpcc_wlm_rule table stores the definition of workload management rules (both assignment rules and workload rules).

ColumnTypeDescription
serial_numberintegerSerial number of the rule.
rule_idintegerUnique ID of the rule shown in the Command Center interface.
rsgnamenameResource group name used to assign rule.
rolenameDatabase role name used to assign rule.
query_tagtextQuery tag string used to assign rule.
dest_rsgnameDestination resource group name for moving a query.
cpu_timeintegerMaximum CPU time consumed by the query.
running_timeintegerMaximum running time for the query.
disk_io_mbintegerMaximum total disk I/O used by the query.
planner_costfloat8Maximum Postgres Planner cost for the query.
orca_costfloat8Maximum GPORCA optimizer ost for the query.
slice_numintegerMaximum number of slices assigned for executing the query.
actionintegerAction to performed when conditions are met.
activebooleanWhether the rule is active or inactive.
ctimetimestamp without time zoneTime the rule was created.
etimetimestamp without time zoneTime that the rule was deleted.
idle sessionjsonJSON string containing parameters for idle session kill rules.
spill_file_mbintSpill file size, in MB.
cpuskew_percentintIf the CPU skew percent of a query is equal to or higher than cpuskew_percent during cpuskew_duration_sec seconds, Command Center executes the rule.
cpuskew_duration_secintIf the CPU skew percent of a query is equal to or higher than cpuskew_percent during cpuskew_duration_sec seconds, Command Center executes the rule.
order_idNOT NULLThe order id of the rule.

gpcc_wlm_log_history

The gpcc_wlm_log_history table stores the log history of workload rule actions that are triggered. Note that log history for assignment rules is not collected.

ColumnTypeDescription
ctimetimestamp without time zoneTime the log entry was created.
tstarttimestamp without time zoneTime the operation started.
tfinishtimestamp without time zoneTime the operation finished.
rule_serial_numberintegerSerial number of the rule.
rule_idintegerUnique ID of the rule shown in the Command Center interface.
tmidintegerA time identifier for the query. All records associated with a query will have the same tmid.
ssidintegerSession id for the database connection. All records associated with the query will have the same ssid.
ccntintegerCommand number within the session. All records associated with the query will have the same ccnt.
actionintegerWorkload rule action that was initiated.
rsgnamenameResource group name used to assign rule.
rolenameDatabase role name used to assign rule.
statustextIndication of whether the action succeeded or failed.
fail_msgtextMessage associated with a failed action.

Data Loading Tables

Command Center uses the gpcc_gpss_job and gpcc_gpss_log tables to store information related to data loading.

gpcc_gpss_job

ColumnTypeDescription
job_idvarchar(32)The job ID.
job_nametextThe job name.
job_typecharacter varying(20)The job type. Currently, there is just one job type: s3.
creatorcharacter varying(64)The creator of the job.
yaml_contenttextYAML description of the job.
is_activebooleanIndicates whether or not the job has been removed. Set to true when the job is submitted or resubmitted. false means the job has been removed.

gpcc_gpss_log

ColumnTypeDescription
ctimetimestamp without time zone.The time when Command Center received the log.
gpss_timetimestamp(0)Greenplum Streaming Server time returned from Greenplum Streaming Server gRPC call.
job_idvarchar(20)The id of the data loading job.
job_name_at_the_timetextThe name of the job at the time Command Center received the log message.
log_typegpmetrics.gpss_log_typeSpecifies whether the log is received from GPSS gRPC streaming calls (marked as ‘event’) or from GPCC API calls (marked as ‘operation’).
ctxintegerContext of event(job status changed to: UNSPECIFIED=0/STOPPED=1/RUNNING=2/ERROR=3/REMOVED=4/SUCCESS=5/SUBMITTED=6), or context of operation(start=0/stop=1/remove=2/submit=3)
operation_statusgpmetrics.gpss_operation_statusThe status of operations (‘success’/‘fail’ for log_type=operation, ‘not_applicable’ for other types).
msgtextAny messages returned from Greenplum Streaming Server.
log_idintegerThe id of the log. Increments automatically. When sorting logs, Command Center uses this value to break ties between logs with the same ctime, log_type, and job_name_at_the_time.

Other Tables

Command Center uses the gpcc_department and gpcc_role_department tables to store information about departments and roles.

gpcc_department

ColumnTypeDescription
dept_idintegerDepartment ID.
dept_namecharacter varying(64)Department name. Limited to 64 characters, can only contain [A-Z][a-z][0-9][_].
dept_statussmallint1 or 0, where 1 indicates active and 0 indicates deleted.

### gpcc_role_department

ColumnTypeDescription
rolnamenameRole name.
dept_idintegerDepartment ID.

User-Defined Functions

The gpmetrics schema includes a number of user-defined functions that provide users with information about queries and about the hosts on which the queries run. You can find the source code for all of these functions in the $GPCC_HOME/sqls/ directory.

In addition, the public schema includes a user-defined function to return recommendations about whether a table should be reindexed. See this section for details.

gpcc_delete_department

The gpcc_delete_department user-defined function deletes a department name from the gpperfmon database. It takes one parameter: the name of the department you want to delete. You may only delete department names that have no roles associated with them.

gpcc_queries_per_hour

The gpcc_queries_per_hour user-defined function returns the average and maximum number of total queries, running queries, queued queries, blocked queries, and finished queries per hour.

Here are some examples:

The first query returns results for the interval between 00:00:00 on the current date and the current time.

The second query returns results for the interval between 00:00:00 on ‘2021-06-07’ and the current time.

The third query returns results for the interval between 00:00:00 on 2021-06-09 and 13:20:05 on 2021-06-09.

gpcc_queries_per_user

The gpcc_queries_per_user user-defined function returns, for each user, the number of queries whose runtime is longer than the input interval, per hour, in the specified time range. The function takes an interval, a start time, and an end time. The default start time is 00:00:00 today. The default end time is the current time. The interval can not be omitted. It accepts PostgreSQL’s INTERVAL value.

Here are some examples:

The first query returns, by user, all queries running longer than 5 minutes for the interval between 00:00:00 on 05/01/2018 and 23:59:59 on 06/01/2018.

The second query returns, by user, all queries running longer than 5 minutes in the interval between 00:00:00 today and the current time.

The third query returns, by user, all queries longer than 5 minutes in the interval between 00:00:00 on 2018-05-01 and the current time.

gpcc_queries_per_user_max_and_total_spill_size

The gpcc_queries_per_user__max_and_total_spill_size user-defined function returns, for each user, the total spill_size and maximum spill_size per query per hour. The function takes a start time and an end time. The default start time is 00:00:00 today. The default end time is the current time.

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复