このセクションでは、テナントのOBKV_HBaseタイプモニタリング項目のパフォーマンスメトリクスである 応答時間(RT) について説明します。レスポンス時間とは、サーバーが単一のSQLを処理するために要する時間であり、具体的にはサーバーがSQLリクエストを受信してから、そのSQLの実行が終了するまでの時間を指します。統計範囲を指定することで、単一ゾーン内またはOBServerノード上のテナントのOBKV_HBaseタイプの 応答時間(RT) データを照会できます。
all
指標の紹介
SQLステートメントの平均処理時間。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| all | obkv_hbase_sql_all_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="191002",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191005",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191008",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191011",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190402",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191017",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191020",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191023",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="191001",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191004",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191007",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191010",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190401",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191016",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191019",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191022",@LABELS}[@INTERVAL])) by (@GBLABELS))
SQL収集
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191002, 191005, 191008, 191011, 190402, 191017, 191020, 191023, 191001, 191004, 191007, 191010, 190401, 191016, 191019, 191022) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191002, 191005, 191008, 191011, 190402, 191017, 191020, 191023, 191001, 191004, 191007, 191010, 190401, 191016, 191019, 191022) and (con_id > 1000 or con_id = 1)
put
指標の紹介
Putステートメントの平均処理時間。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| put | obkv_hbase_sql_put_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191005",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191004",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191005, 191004) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191005, 191004) and (con_id > 1000 or con_id = 1)
delete
指標の紹介
DELETEステートメントの平均処理時間。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| delete | obkv_hbase_sql_delete_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191008",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191007",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191008, 191007) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以上のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191008, 191007) and (con_id > 1000 or con_id = 1)
append
指標の紹介
APPENDステートメントの平均処理時間。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| append | obkv_hbase_sql_append_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191011",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191010",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191011, 191010) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191011, 191010) and (con_id > 1000 or con_id = 1)
increment
指標紹介
Incrementステートメントの平均処理時間です。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| increment | obkv_hbase_sql_increment_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="190402",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="190401",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190402, 190401) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190402, 190401) and (con_id > 1000 or con_id = 1)
checkAndPut
指標紹介
checkAndPutステートメントの平均処理時間です。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| checkAndPut | obkv_hbase_sql_checkAndPut_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191017",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191016",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191017, 191016) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191017, 191016) and (con_id > 1000 or con_id = 1)
checkAndDelete
指標の紹介
CheckAndDeleteステートメントの平均処理時間。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| checkAndDelete | obkv_hbase_sql_checkAndDelete_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191020",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191019",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
OceanBase V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191020, 191019) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191020, 191019) and (con_id > 1000 or con_id = 1)
hybrid batch
指標の紹介
hybrid batchステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| hybrid batch | obkv_hbase_sql_hybrid_batch_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191023",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191022",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191023, 191022) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191023, 191022) and (con_id > 1000 or con_id = 1)
scan
指標の紹介
scanステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| scan | obkv_hbase_sql_scan_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="191002",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="191001",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191002, 191001) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (191002, 191001) and (con_id > 1000 or con_id = 1)
99-all
指標の紹介
SQLステートメントの平均処理時間TP99。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 99-all | obkv_hbase_sql_all_rt_tp99 | μs |
計算式
histogram_quantile(0.99, sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE SCAN", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE PUT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE APPEND", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE INCREMENT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE CHECK AND PUT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE CHECK AND DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE HYBRID BATCH", @LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
WITH histogram_data AS (SELECT t1.tenant_id, t1.svr_ip, t1.sql_type, CASE WHEN t1.response_time >= t0.max_rt THEN '+Inf' ELSE t1.response_time * 1000000 END AS response_time, t1.total_count, t1.total_value * 1000000 AS total_value, SUM(t2.total_count) AS cumulative_count, SUM(t2.total_value) * 1000000 AS cumulative_value FROM (SELECT MAX(response_time) AS max_rt FROM gv$ob_query_response_time_histogram) t0 JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t1 ON 1=1 INNER JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t2 ON t1.response_time >= t2.response_time AND t1.tenant_id = t2.tenant_id AND t1.svr_ip = t2.svr_ip AND t1.sql_type = t2.sql_type WHERE t1.svr_ip = ? AND t1.sql_type IN ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER', 'INNER SQL', 'TABLEAPI SELECT', 'TABLEAPI INSERT', 'TABLEAPI DELETE', 'TABLEAPI UPDATE', 'TABLEAPI REPLACE', 'TABLEAPI QUERY AND MUTATE', 'TABLEAPI OTHER', 'HBASE SCAN', 'HBASE PUT', 'HBASE DELETE', 'HBASE APPEND', 'HBASE INCREMENT', 'HBASE CHECK AND PUT', 'HBASE CHECK AND DELETE', 'HBASE HYBRID BATCH', 'REDIS SET', 'REDIS GET', 'REDIS HSET', 'REDIS HGET', 'REDIS LPUSH', 'REDIS LPOP', 'REDIS SADD', 'REDIS ZADD') GROUP BY t1.response_time, t1.tenant_id, t1.sql_type) SELECT * FROM (SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type NOT LIKE 'TABLEAPI %' AND sql_type NOT LIKE 'HBASE %' AND sql_type NOT LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type = sql_type AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'TABLEAPI %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'TABLEAPI %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'HBASE %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'HBASE %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'REDIS %' AND cumulative_count > 0)) all_histogram_data ORDER BY tenant_id, svr_ip, sql_type, response_time
95-all
指標の紹介
SQLステートメントの平均処理時間TP95。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 95-all | obkv_hbase_sql_all_rt_tp95 | μs |
計算式
histogram_quantile(0.95, sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE SCAN", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE PUT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE APPEND", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE INCREMENT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE CHECK AND PUT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE CHECK AND DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE HYBRID BATCH", @LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
WITH histogram_data AS (SELECT t1.tenant_id, t1.svr_ip, t1.sql_type, CASE WHEN t1.response_time >= t0.max_rt THEN '+Inf' ELSE t1.response_time * 1000000 END AS response_time, t1.total_count, t1.total_value * 1000000 AS total_value, SUM(t2.total_count) AS cumulative_count, SUM(t2.total_value) * 1000000 AS cumulative_value FROM (SELECT MAX(response_time) AS max_rt FROM gv$ob_query_response_time_histogram) t0 JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t1 ON 1=1 INNER JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t2 ON t1.response_time >= t2.response_time AND t1.tenant_id = t2.tenant_id AND t1.svr_ip = t2.svr_ip AND t1.sql_type = t2.sql_type WHERE t1.svr_ip = ? AND t1.sql_type IN ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER', 'INNER SQL', 'TABLEAPI SELECT', 'TABLEAPI INSERT', 'TABLEAPI DELETE', 'TABLEAPI UPDATE', 'TABLEAPI REPLACE', 'TABLEAPI QUERY AND MUTATE', 'TABLEAPI OTHER', 'HBASE SCAN', 'HBASE PUT', 'HBASE DELETE', 'HBASE APPEND', 'HBASE INCREMENT', 'HBASE CHECK AND PUT', 'HBASE CHECK AND DELETE', 'HBASE HYBRID BATCH', 'REDIS SET', 'REDIS GET', 'REDIS HSET', 'REDIS HGET', 'REDIS LPUSH', 'REDIS LPOP', 'REDIS SADD', 'REDIS ZADD') GROUP BY t1.response_time, t1.tenant_id, t1.sql_type) SELECT * FROM (SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type NOT LIKE 'TABLEAPI %' AND sql_type NOT LIKE 'HBASE %' AND sql_type NOT LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type = sql_type AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'TABLEAPI %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'TABLEAPI %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'HBASE %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'HBASE %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'REDIS %' AND cumulative_count > 0)) all_histogram_data ORDER BY tenant_id, svr_ip, sql_type, response_time
90-all
指標の紹介
SQLステートメントの平均処理時間TP90。
指標パラメータの説明
メトリクス項目 |
メトリクス名 |
単位 |
|---|---|---|
| 90-all | obkv_hbase_sql_all_rt_tp90 | μs |
計算式
histogram_quantile(0.90, sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE SCAN", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE PUT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE APPEND", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE INCREMENT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE CHECK AND PUT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE CHECK AND DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="HBASE HYBRID BATCH", @LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
WITH histogram_data AS (SELECT t1.tenant_id, t1.svr_ip, t1.sql_type, CASE WHEN t1.response_time >= t0.max_rt THEN '+Inf' ELSE t1.response_time * 1000000 END AS response_time, t1.total_count, t1.total_value * 1000000 AS total_value, SUM(t2.total_count) AS cumulative_count, SUM(t2.total_value) * 1000000 AS cumulative_value FROM (SELECT MAX(response_time) AS max_rt FROM gv$ob_query_response_time_histogram) t0 JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t1 ON 1=1 INNER JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t2 ON t1.response_time >= t2.response_time AND t1.tenant_id = t2.tenant_id AND t1.svr_ip = t2.svr_ip AND t1.sql_type = t2.sql_type WHERE t1.svr_ip = ? AND t1.sql_type IN ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER', 'INNER SQL', 'TABLEAPI SELECT', 'TABLEAPI INSERT', 'TABLEAPI DELETE', 'TABLEAPI UPDATE', 'TABLEAPI REPLACE', 'TABLEAPI QUERY AND MUTATE', 'TABLEAPI OTHER', 'HBASE SCAN', 'HBASE PUT', 'HBASE DELETE', 'HBASE APPEND', 'HBASE INCREMENT', 'HBASE CHECK AND PUT', 'HBASE CHECK AND DELETE', 'HBASE HYBRID BATCH', 'REDIS SET', 'REDIS GET', 'REDIS HSET', 'REDIS HGET', 'REDIS LPUSH', 'REDIS LPOP', 'REDIS SADD', 'REDIS ZADD') GROUP BY t1.response_time, t1.tenant_id, t1.sql_type) SELECT * FROM (SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type NOT LIKE 'TABLEAPI %' AND sql_type NOT LIKE 'HBASE %' AND sql_type NOT LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type = sql_type AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'TABLEAPI %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'TABLEAPI %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'HBASE %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'HBASE %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'REDIS %' AND cumulative_count > 0)) all_histogram_data ORDER BY tenant_id, svr_ip, sql_type, response_time