[MySQL Reference Manual] 24 MySQL sys框架
24 MySQL sys框架
24 MySQL sys框架... 1
24.1 sys框架的前提條件... 1
24.2 使用sys框架... 2
24.3 sys框架進度報告... 3
24.4 sys框架的對象... 3
24.4.1所有sys下的對象... 3
24.4.2 sys框架的表和觸發器... 8
24.4.2.1 sys_config. 8
24.4.3 性能框架視圖... 10
24.4.4 sys框架存儲過程... 13
24.4.5 sys框架存儲函數... 14
24.1 sys框架的前提條件
在開始使用sys框架之前,有一些前提條件,sys需要mysql 5.6或者更高版本。因為sys是performance_schema的替代方案,performance_schema必須啟動,sys才能夠使用。
為了完全訪問sys,需要有以下權限:
· Sys表和視圖的select權限。
· Sys存儲過程和函數的exec權限。
· Sys_config表的insert,update權限。
· 另外執行存儲過程需要一些其他的權限,可以看存儲過程的描述。
其他權限:
· Sys框架對象訪問的任何performance_Schema的表的select權限,和sys框架對象更新的任何表的update權限。
· Information_schema.innodb_buffer_page的process表。
特定的performance_Schema消費者和記錄點要啟動:
· 所有的等待記錄點
· 所有stage記錄點
· 所有statement記錄點
· Xxx_current和xxx_history_long消費者相關的所有事件。
你可以使用sys下面的存儲過程啟動所有這些選項:
CALL sys.ps_setup_enable_instrument('wait');
CALL sys.ps_setup_enable_instrument('stage');
CALL sys.ps_setup_enable_instrument('statement');
CALL sys.ps_setup_enable_consumer('current');
CALL sys.ps_setup_enable_consumer('history_long');
注意點:
對于很多sys的使用,默認的性能框架數據收集就能夠滿足,啟動所有的記錄點和消費者會對性能有一點影響,所以最好只啟動你要的配置。通過這個函數也可以返回默認配置:
CALL
sys.ps_setup_reset_to_default(TRUE);
24.2 使用sys框架
查看sys版本和mysql版本:
mysql> USE sys;
Database changed
mysql> SELECT * FROM version;
+-------------+-----------------+
| sys_version |
mysql_version |
+-------------+-----------------+
|
1.5.0 | 5.7.9-debug-log |
+-------------+-----------------+
Sys框架下包含了很多視圖合計了性能框架的表。很多這些視圖成對出現的,比如一個成員的名字和另外一個一樣,只是加了x$的前綴。比如host_summary_by_file_io有個名字一樣的x$host_summary_by_file_io,2個顯示的單位不同。
mysql> SELECT * FROM
host_summary_by_file_io;
+------------+-------+------------+
|
host | ios | io_latency |
+------------+-------+------------+
| localhost
| 67570 | 5.38 s |
| background
| 3468 | 4.18 s |
+------------+-------+------------+
mysql> SELECT * FROM
x$host_summary_by_file_io;
+------------+-------+---------------+
|
host | ios |
io_latency |
+------------+-------+---------------+
| localhost
| 67574 | 5380678125144 |
| background
| 3474 | 4758696829416 |
+------------+-------+---------------+
沒有x$前綴的表更容易讀。帶x$和不帶x$顯示的數值是一樣大的用來用具獲取和處理這些數據。
可以使用show 語句或者information_schema的查詢獲取對象的定義比如:
mysql> SHOW CREATE VIEW session;
mysql> SHOW CREATE FUNCTION format_bytes;
mysqldump,mysqlpump默認不導出sys框架,導出sys需要顯示設置:
mysqldump
--databases --routines sys > sys_dump.sql
mysqlpump sys > sys_dump.sql
導入sys結構:
mysql <
sys_dump.sql
24.3 sys框架進度報告
Mysql 5.7.9,在sys下提供了長運行事務的進度報告:
Processlist
session
x$processlist
x$session
假設請求的記錄點和消費者已經啟動了,這些視圖的progress列顯示了完成的百分比。
stage進度報告要啟動events_stages_current消費者,還有一些需要啟動的記錄點信息:
stage/sql/Copying
to tmp table
stage/innodb/alter table (end)
stage/innodb/alter table (flush)
stage/innodb/alter table (insert)
stage/innodb/alter table (log apply index)
stage/innodb/alter table (log apply table)
stage/innodb/alter table (merge sort)
stage/innodb/alter table (read PK 和 internal sort)
stage/innodb/buffer pool load
對于stage不支持簡歷和完成工作報告,如果請求記錄點和消費者沒有啟動,progress列為null。
24.4 sys框架的對象
24.4.1所有sys下的對象
Table 24.1 sys Schema
Tables 和 Triggers
|
Table or |
Description |
|
sys_config |
sys schema configuration options |
|
sys_config_insert_set_user |
sys_config insert trigger |
|
sys_config_update_set_user |
sys_config update trigger |
Table 24.2 sys Schema Views
|
View Name |
Description |
|
host_summary, x$host_summary |
Statement |
|
host_summary_by_file_io, x$host_summary_by_file_io |
File I/O, |
|
host_summary_by_file_io_type, x$host_summary_by_file_io_type |
File I/O, |
|
host_summary_by_stages, x$host_summary_by_stages |
Statement |
|
host_summary_by_statement_latency, x$host_summary_by_statement_latency |
Statement |
|
host_summary_by_statement_type, x$host_summary_by_statement_type |
Statements |
|
innodb_buffer_stats_by_schema, x$innodb_buffer_stats_by_schema |
InnoDB buffer information, grouped by schema |
|
innodb_buffer_stats_by_table, x$innodb_buffer_stats_by_table |
InnoDB buffer information, grouped by schema 和 table |
|
innodb_lock_waits, x$innodb_lock_waits |
InnoDB lock information |
|
io_by_thread_by_latency, x$io_by_thread_by_latency |
I/O consumers, |
|
io_global_by_file_by_bytes, x$io_global_by_file_by_bytes |
Global I/O |
|
io_global_by_file_by_latency, x$io_global_by_file_by_latency |
Global I/O |
|
io_global_by_wait_by_bytes, x$io_global_by_wait_by_bytes |
Global I/O |
|
io_global_by_wait_by_latency, x$io_global_by_wait_by_latency |
Global I/O |
|
latest_file_io, x$latest_file_io |
Most recent |
|
memory_by_host_by_current_bytes, x$memory_by_host_by_current_bytes |
Memory use, |
|
memory_by_thread_by_current_bytes, x$memory_by_thread_by_current_bytes |
Memory use, |
|
memory_by_user_by_current_bytes, x$memory_by_user_by_current_bytes |
Memory use, |
|
memory_global_by_current_bytes, x$memory_global_by_current_bytes |
Memory use, |
|
memory_global_total, x$memory_global_total |
Total memory |
|
metrics |
Server metrics |
|
processlist, x$processlist |
Processlist |
|
ps_check_lost_instrumentation |
Variables that |
|
schema_auto_increment_columns |
AUTO_INCREMENT column information |
|
schema_index_statistics, x$schema_index_statistics |
Index |
|
schema_object_overview |
Types of |
|
schema_redundant_indexes |
Duplicate or |
|
schema_table_lock_waits, x$schema_table_lock_waits |
Sessions |
|
schema_table_statistics, x$schema_table_statistics |
Table |
|
schema_table_statistics_with_buffer,x$schema_table_statistics_with_buffer |
Table |
|
schema_tables_with_full_table_scans,x$schema_tables_with_full_table_scans |
Tables being |
|
schema_unused_indexes |
Indexes not in |
|
session, x$session |
Processlist |
|
session_ssl_status |
Connection SSL |
|
statement_analysis, x$statement_analysis |
Statement |
|
statements_with_errors_or_warnings, x$statements_with_errors_or_warnings |
Statements that |
|
statements_with_full_table_scans, x$statements_with_full_table_scans |
Statements that |
|
statements_with_runtimes_in_95th_percentile,x$statements_with_runtimes_in_95th_percentile |
Statements with |
|
statements_with_sorting, x$statements_with_sorting |
Statements that |
|
statements_with_temp_tables, x$statements_with_temp_tables |
Statements that |
|
user_summary, x$user_summary |
User statement 和 connection |
|
user_summary_by_file_io, x$user_summary_by_file_io |
File I/O, |
|
user_summary_by_file_io_type, x$user_summary_by_file_io_type |
File I/O, |
|
user_summary_by_stages, x$user_summary_by_stages |
Stage events, |
|
user_summary_by_statement_latency, x$user_summary_by_statement_latency |
Statement |
|
user_summary_by_statement_type, x$user_summary_by_statement_type |
Statements |
|
version |
Current sys schema 和 MySQL server |
|
wait_classes_global_by_avg_latency, x$wait_classes_global_by_avg_latency |
Wait class |
|
wait_classes_global_by_latency, x$wait_classes_global_by_latency |
Wait class |
|
waits_by_host_by_latency, x$waits_by_host_by_latency |
Wait events, |
|
waits_by_user_by_latency, x$waits_by_user_by_latency |
Wait events, |
|
waits_global_by_latency, x$waits_global_by_latency |
Wait events, |
|
x$ps_digest_95th_percentile_by_avg_us |
Helper view for |
|
x$ps_digest_avg_latency_distribution |
Helper view for |
|
x$ps_schema_table_statistics_io |
Helper view for |
|
x$schema_flattened_keys |
Helper view |
Table 24.3 sys Schema Stored Procedures
|
Procedure Name |
Description |
|
create_synonym_db() |
Create synonym |
|
diagnostics() |
Collect system |
|
execute_prepared_stmt() |
Execute |
|
ps_setup_disable_background_threads() |
Disable |
|
ps_setup_disable_consumer() |
Disable |
|
ps_setup_disable_instrument() |
Disable |
|
ps_setup_disable_thread() |
Disable |
|
ps_setup_enable_background_threads() |
Enable |
|
ps_setup_enable_consumer() |
Enable |
|
ps_setup_enable_instrument() |
Enable |
|
ps_setup_enable_thread() |
Enable |
|
ps_setup_reload_saved() |
Reload saved |
|
ps_setup_reset_to_default() |
Reset saved |
|
ps_setup_save() |
Save |
|
ps_setup_show_disabled() |
Display |
|
ps_setup_show_disabled_consumers() |
Display |
|
ps_setup_show_disabled_instruments() |
Display |
|
ps_setup_show_enabled() |
Display enabled |
|
ps_setup_show_enabled_consumers() |
Display enabled |
|
ps_setup_show_enabled_instruments() |
Display enabled |
|
ps_statement_avg_latency_histogram() |
Display |
|
ps_trace_statement_digest() |
Trace |
|
ps_trace_thread() |
Dump |
|
ps_truncate_all_tables() |
Truncate |
|
statement_performance_analyzer() |
Report of |
|
table_exists() |
Whether a table |
Table 24.4 sys Schema Stored Functions
|
Function Name |
Description |
|
extract_schema_from_file_name() |
Extract schema |
|
extract_table_from_file_name() |
Extract table |
|
format_bytes() |
Convert byte |
|
format_path() |
Replace data 和 temp-file |
|
format_statement() |
Truncate long |
|
format_time() |
Convert |
|
list_add() |
Add item to |
|
list_drop() |
Remove item |
|
ps_is_account_enabled() |
Check whether |
|
ps_is_consumer_enabled() |
Check whether |
|
ps_is_instrument_default_enabled() |
Check whether |
|
ps_is_instrument_default_timed() |
Check whether |
|
ps_is_thread_instrumented() |
Check whether |
|
ps_thread_account() |
Return account |
|
ps_thread_id() |
Return thread |
|
ps_thread_stack() |
Return event |
|
ps_thread_trx_info() |
Return |
|
quote_identifier() |
Return string |
|
sys_get_config() |
Return sys schema configuration option |
|
version_major() |
MySQL server |
|
version_minor() |
MySQL server |
|
version_patch() |
MySQL server |
24.4.2 sys框架的表和觸發器
24.4.2.1 sys_config
Sys_config表列:
·
Variable:配置選項
·
value:選項的值
·
set_time:最近一次修改時間。
·
set_by:最近一次修改用戶
為了最小化直接讀取sys_config表的影響,sys框架下的函數用來檢查用戶定義的變量和相關的名字,這個名字使用變量以@sys.為前綴。如果當前會話有用戶定義的變量部位null,那么就優先使用變量上的長度。否則就讀取表上的值:
mysql> SET @stmt = 'SELECT variable, value,
set_time, set_by FROM sys_config';
mysql> SELECT format_statement(@stmt);
+----------------------------------------------------------+
|
format_statement(@stmt)
|
+----------------------------------------------------------+
| SELECT
variable, value, set_time, set_by FROM sys_config |
+----------------------------------------------------------+
mysql> SET @sys.statement_truncate_len = 32;
mysql> SELECT format_statement(@stmt);
+-----------------------------------+
|
format_statement(@stmt)
|
+-----------------------------------+
| SELECT variabl
... ROM sys_config |
+-----------------------------------+
之后會話中的會繼續使用變量的32,而不是使用表里面的64。
為了停止變量的使用可以使用以下語句,取消或者關閉當前會話:
mysql> SET @sys.statement_truncate_len =
NULL;
mysql> SELECT format_statement(@stmt);
+----------------------------------------------------------+
|
format_statement(@stmt)
|
+----------------------------------------------------------+
| SELECT
variable, value, set_time, set_by FROM sys_config |
變量可以在會話結束前生效,如果sys_config在會話中被修改,這個修改不會體現在會話上,除非會話結束。
Sys_config和變量的配置值:
·
diagnostics.all_i_s_tables, @sys.diagnostics.all_i_s_tables
如果選項為on,diagnostics()過程允許對information_schema.tables表進行掃描。如果表很多這個操作花費就比較大。
·
diagnostics.include_raw,@sys. diagnostics.include_raw
如果選項為on,diagnostics()過程包含了metrics視圖輸出的原生數據。默認為off。
·
ps_thread_trx_info.max_length,@sys. ps_thread_trx_info.max_length
ps_thread_trx_info()函數輸出的最大json的長度。
·
statement_performance_analyzer.limit,@sys.statement_performance_analyzer.limit
視圖返回的最大行數,編譯沒有限制。最大為100.
·
statement_performance_analyzer.view,@sys.statement_performance_analyzer.view
statement_performance_analyzer()過程使用到的視圖和查詢。如果選項值包含了空間就表示是一個查詢,否則必須是events_statements_summary_by_digest表上的視圖。如果上面的limit>0就不能有limit子句。默認我null。
·
statement_truncate_len,
@sys.statement_truncate_len
format_statement()函數返回的最大語句長度,長的語句會被截斷,默認64.
其他選項可以通過sys_config表添加。比如diagnostics(),execute_prepared_stmt()的調試選項,但是不是sys_config的默認有的選項:
mysql> INSERT INTO sys_config (variable,
value) VALUES('debug', 'ON');
修改debug信息:
mysql> UPDATE sys_config SET value = 'OFF'
WHERE variable = 'debug';
mysql> SET @sys.debug = NULL;
24.4.3 性能框架視圖
·
host_summary 和
x$host_summary Views
視圖顯示了語句活動,文件io和連接信息,由host分組
·
host_summary_by_file_io 和 x$host_summary_by_file_io Views
視圖總計了文件io,由host分組
·
host_summary_by_file_io_type 和 x$host_summary_by_file_io_type Views
視圖總計了文件io,由host和event類型分組。
·
host_summary_by_stages 和 x$host_summary_by_stages Views
總計語句stage,由host分組
·
host_summary_by_statement_latency 和 x$host_summary_by_statement_latency Views
總計語句的統計信息,由host分組
·
host_summary_by_statement_type 和 x$host_summary_by_statement_type Views
總計語句的執行,由host和語句類型分組
·
innodb_buffer_stats_by_schema 和 x$innodb_buffer_stats_by_schema Views
統計information_schema.innodb_buffer_page,由schema分組,object_schema為對象的schema,如果為innodb表屬于innodb system。
·
innodb_buffer_stats_by_table 和 x$innodb_buffer_stats_by_table Views
統計information_schema.innodb_buffer_page,由表名分組。
·
innodb_lock_waits 和 x$innodb_lock_waits Views
總計了innodb鎖等待。列如下:
wait_started:等待開始事件。
wait_age:等待鎖的時間長度。
wait_age_secs:等待了多少秒。
locked_table:被鎖定的表。
locked_index:被鎖的索引
locked_type:鎖等待類型
waiting_trx_started:等待事務的開始事件。
waiting_trx_age:等待事務等待時間。
waiting_trx_rows_locked:等待事務鎖定的行鎖個數。
……
·
io_by_thread_by_latency 和 x$io_by_thread_by_latency Views
總計了IO消費者顯示了線程的IO等待。
·
io_global_by_file_by_bytes 和 x$io_global_by_file_by_bytes Views
總計了IO消費者顯示每個文件的讀寫量,由文件分組
·
io_global_by_file_by_latency 和 x$io_global_by_file_by_latency Views
總結io消費者顯示io次數和延遲事件,由文件分組
·
io_global_by_wait_by_bytes 和 x$io_global_by_wait_by_bytes Views
每個event的總io字節。
·
io_global_by_wait_by_latency 和 x$io_global_by_wait_by_latency Views
每個event的總io次數和io等待時間
·
latest_file_io 和 x$latest_file_io Views
總計活動的文件IO,由文件和線程分組。
·
memory_by_host_by_current_bytes 和 x$memory_by_host_by_current_bytes Views
總計host使用的總內存
·
memory_by_thread_by_current_bytes 和 x$memory_by_thread_by_current_bytes Views
線程的內存使用
·
memory_by_user_by_current_bytes 和 x$memory_by_user_by_current_bytes Views
總計用戶使用的內存
·
memory_global_by_current_bytes 和 x$memory_global_by_current_bytes Views
每個分配類型分配的內存
·
memory_global_total 和 x$memory_global_total Views
服務的總內存使用
·
metrics View
視圖總計mysql服務的指標,顯示變量名,變量值,類型和他們的啟動情況。視圖在mysql 5.7.9被添加,視圖主要包含信息:
o
全局的狀態變量,來至于global_status表。
o
來自information_schema.global_status.Innodb指標
o
當前和所有內存分配
o
當前時間
有一些在global_status和innodb_status中有重復的指標,metrics視圖會進行消除。
·
processlist 和
x$processlist Views
比show processlist返回的信息更加詳細
·
ps_check_lost_instrumentation View
返回丟失的性能框架記錄點,顯示是否性能框架可以跟蹤所有數據。
·
schema_auto_increment_columns View
視圖顯示了有auto_increment的列,并且提供了有用的信息。
·
schema_index_statistics 和 x$schema_index_statistics Views
視圖提供的所有統計信息
·
schema_object_overview View
schema下對象統計
·
schema_redundant_indexes 和 x$schema_flattened_keys Views
顯示了冗余的索引
·
schema_table_lock_waits 和 x$schema_table_lock_waits Views
顯示了哪些會話被元數據鎖鎖定,什么鎖定了它們
·
schema_table_statistics 和 x$schema_table_statistics Views
表操作的統計,io和延遲的統計
·
schema_table_statistics_with_buffer 和 x$schema_table_statistics_with_buffer Views
表操作的統計,io和延遲的統計,和內存的分配
·
schema_tables_with_full_table_scans 和 x$schema_tables_with_full_table_scans Views
顯示了哪些表被表掃描訪問
·
schema_unused_indexes View
未使用過的索引
·
session 和
x$session Views
和processlist相似但是不顯示后臺進程
·
session_ssl_status View
對于每個連接顯示SSL版本,chipher和count
·
statement_analysis 和 x$statement_analysis Views
顯示了語句的執行情況,執行次數,響應行數,延遲等
·
statements_with_errors_or_warnings 和 x$statements_with_errors_or_warnings Views
語句的錯誤或者警告
·
statements_with_full_table_scans 和 x$statements_with_full_table_scans Views
用到了表掃描的語句
·
statements_with_runtimes_in_95th_percentile和 x$statements_with_runtimes_in_95th_percentile
Views
runtimes在95%以內的語句
·
statements_with_sorting 和 x$statements_with_sorting Views
執行了排序的語句
·
statements_with_temp_tables 和 x$statements_with_temp_tables Views
使用了臨時表的語句
·
user_summary 和
x$user_summary Views
用戶總計信息,包含語句,文件io,連接
·
user_summary_by_file_io 和 x$user_summary_by_file_io Views
用戶文件io總計
·
user_summary_by_file_io_type 和 x$user_summary_by_file_io_type Views
用戶文件io類型總計
·
user_summary_by_stages 和 x$user_summary_by_stages Views
用戶stage事件總計
·
user_summary_by_statement_latency 和 x$user_summary_by_statement_latency Views
用戶在執行語句上的延遲
·
user_summary_by_statement_type 和 x$user_summary_by_statement_type Views
用戶在語句類型上的延遲
·
version View
版本
·
wait_classes_global_by_avg_latency 和 x$wait_classes_global_by_avg_latency Views
等待類型延遲匯總,由平均延遲排序
·
wait_classes_global_by_latency 和 x$wait_classes_global_by_latency Views
等待類型延遲匯總,由總延遲排序
·
waits_by_host_by_latency 和 x$waits_by_host_by_latency Views
host,等待事件延遲匯總
·
waits_by_user_by_latency 和 x$waits_by_user_by_latency Views
用戶等待事件延遲
·
waits_global_by_latency 和 x$waits_global_by_latency Views
等待事件延遲。
24.4.4 sys框架存儲過程
·
The create_synonym_db() Procedure
創建一個別名數據庫,指向被引用的數據庫,使用視圖指向被引用數據庫的表
·
The diagnostics() Procedure
當前服務器的狀態,包含了mysql服務版本信息,系統變量,innodb狀態,processlist,內存使用信息,performance_schema狀態,和一些狀態信息。輸出到diag.out文件
mysql> tee diag.out;
mysql> CALL diagnostics(120, 30, 'current');
mysql> notee;
· The execute_prepared_stmt() Procedure
以已準備好的語句,來執行。準備好的語句在執行完成后被釋放,所以并不能重用。可以用來執行的動態語句。
·
The
ps_setup_disable_background_threads() Procedure
禁止后臺進程的所有性能框架記錄點
·
The ps_setup_disable_consumer()
Procedure
禁用某個消費者
·
The ps_setup_disable_instrument()
Procedure
禁用記錄點
·
The ps_setup_disable_thread()
Procedure
根據連接id,禁用某個線程
·
The
ps_setup_enable_background_threads() Procedure
啟動后臺線程的性能框架記錄
·
The ps_setup_enable_consumer()
Procedure
啟動某個性能框架消費者
·
The ps_setup_enable_instrument()
Procedure
啟動某個性能框架記錄點
·
The ps_setup_enable_thread()
Procedure
啟動某個連接id對應線程的記錄點
·
The ps_setup_reload_saved() Procedure
重新加載性能框架配置,使用之前ps_setup_save保存的配置
·
The ps_setup_reset_to_default()
Procedure
重置到默認配置
·
The ps_setup_save() Procedure
保存性能框架配置,這樣可以根據調試要求先調整,然后恢復
·
The ps_setup_show_disabled()
Procedure
顯示當前所有禁用的配置
·
The
ps_setup_show_disabled_consumers() Procedure
顯示所有禁用的消費者
·
The ps_setup_show_disabled_instruments()
Procedure
顯示禁用的記錄點
·
The ps_setup_show_enabled() Procedure
顯示啟動的性能框架配置
·
The ps_setup_show_enabled_consumers()
Procedure
顯示啟動的消費者
·
The
ps_setup_show_enabled_instruments() Procedure
顯示啟動的記錄點
·
The
ps_statement_avg_latency_histogram() Procedure
直方圖顯示語句的平均延遲
·
The ps_trace_statement_digest()
Procedure
跟蹤指定語句digest的所有性能記錄點。
·
The ps_trace_thread() Procedure
指定連接id的所有性能記錄點
·
The ps_truncate_all_tables()
Procedure
清空所有性能框架summary表
·
The statement_performance_analyzer()
Procedure
創建語句在服務端上運行的報表
·
The table_exists() Procedure
判斷是否存在表,視圖,臨時表
24.4.5 sys框架存儲函數
The extract_schema_from_file_name() Function
根據文件路徑獲取對應的數據庫名
The extract_table_from_file_name() Function
根據文件路徑獲取表名
The format_bytes() Function
給字節數,轉化為可讀的格式
The format_path() Function
文件路徑格式化
The format_statement() Function
格式化語句輸出,輸出長度和statement_truncate_len配置有關。
The format_time() Function
時間格式化
The list_add() Function
增加一個由逗號隔開的隊列中。
The list_drop() Function
從逗號隔開的隊列的隊列中刪除一個元素
The ps_is_account_enabled() Function
判斷賬號是否啟動
The ps_is_consumer_enabled() Function
判斷消費者是否啟動
The ps_is_instrument_default_enabled() Function
判斷記錄點是否默認啟動
The ps_is_instrument_default_timed() Function
給定記錄點默認是否是被計時的。
The ps_is_thread_instrumented() Function
判斷連接id對應的性能框架記錄點啟動
The ps_thread_account() Function
給定連接id,判斷線程啟動的用戶。
The ps_thread_id() Function
給定連接id返回線程id
The ps_thread_stack() Function
給定線程id,返回json格式的語句,stages,events的stack
The ps_thread_trx_info() Function
返回線程id的事務和已經執行的語句
The quote_identifier() Function
引用分隔符
The sys_get_config() Function
獲取sys_config表的數據
The version_major() Function
mysql主版本
The version_minor() Function
mysql次版本
The version_patch() Function
mysql補丁號
總結
以上是生活随笔為你收集整理的[MySQL Reference Manual] 24 MySQL sys框架的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Centos7更改网卡名称Eth0
- 下一篇: linux cmake编译源码,linu