This topic describes the monitoring metrics related to SQL execution plan time of an OceanBase Database tenant. The metrics include time consuming of processing local executions, time consuming of processing remote executions, and time consuming of processing distributed executions. You can specify a statistical range to query statistics about the SQL execution plan time in a single zone or on a single OBServer of an OceanBase Database tenant.
local
Definition
The time consuming of processing local executions in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| local | sql_local_time | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id=“40116”,@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id=“40010”,@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40010, 40116) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40010, 40116) and (con_id > 1000 or con_id = 1) and class < 1000
remote
Definition
The time consuming of processing remote executions in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| remote | sql_remote_time | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id=“40117”,@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id=“40011”,@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40011, 40117) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40011, 40117) and (con_id > 1000 or con_id = 1) and class < 1000
distributed
Definition
The time consuming of processing distributed executions in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| distributed | sql_distributed_time | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id=“40118”,@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id=“40012”,@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40012, 40118) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40012, 40118) and (con_id > 1000 or con_id = 1) and class < 1000