-- ?Purge ?Table dbms_recycle .purge_table ('');-- ?Restore ?table dbms_recycle .restore_table ('' ,'' ,'' );-- ?Show ?tables mysql > call ?dbms_recycle .show_tables (); +----------------- +--------------- +--------------- +-------------- +--------------------- +--------------------- + | SCHEMA ??????????| TABLE ?????????| ORIGIN_SCHEMA ?| ORIGIN_TABLE ?| RECYCLED_TIME ???????| PURGE_TIME ??????????| +----------------- +--------------- +--------------- +-------------- +--------------------- +--------------------- + | __recycle_bin__ ?| __innodb_1063 ?| product_db ????| t1 ???????????| 2019-08-08 ?11 :01 :46 ?| 2019-08-15 ?11 :01 :46 ?| | __recycle_bin__ ?| __innodb_1064 ?| product_db ????| t2 ???????????| 2019-08-08 ?11 :01 :46 ?| 2019-08-15 ?11 :01 :46 ?| | __recycle_bin__ ?| __innodb_1065 ?| product_db ????| parent ???????| 2019-08-08 ?11 :01 :46 ?| 2019-08-15 ?11 :01 :46 ?| | __recycle_bin__ ?| __innodb_1066 ?| product_db ????| child ????????| 2019-08-08 ?11 :01 :46 ?| 2019-08-15 ?11 :01 :46 ?| +----------------- +--------------- +--------------- +-------------- +--------------------- +--------------------- +4 ?rows ?in ?set ?(0.00 ?sec)4.3 Returning GalaxyEngine 提供 returning 功能,支持 DML 語(yǔ)句返回 Resultset,同時(shí)提供了工具包(DBMS_TRANS)便于您快捷使用。 DBMS_TRANS.returning(<Field_list > ,<Statement > ); mysql> call dbms_trans.returning("*" , "insert into t(id) values(NULL),(NULL)" ); +----+------+---------------------+| id | ?col1 | col2 | +----+------+---------------------+| 1 | ????1 ?| 2019-09-03 10:39:05 | | 2 | ????1 ?| 2019-09-03 10:39:05 | +----+------+---------------------+2 ?rows in ?set (0 .01 ?sec) mysql> call dbms_trans.returning("id, col1, col2" , "update t set col1 = 2 where id >2" ); +----+------+---------------------+| id | ?col1 | col2 | +----+------+---------------------+| 3 | ????2 ?| 2019-09-03 10:41:06 | | 4 | ????2 ?| 2019-09-03 10:41:06 | +----+------+---------------------+2 ?rows in ?set (0 .01 ?sec) mysql> call dbms_trans.returning("id, col1, col2" , "delete from t where id < 3" ); +----+------+---------------------+| id | ?col1 | col2 | +----+------+---------------------+| 1 | ????1 ?| 2019-09-03 10:40:55 | | 2 | ????1 ?| 2019-09-03 10:40:55 | +----+------+---------------------+2 ?rows in ?set (0 .00 ?sec) 4.4 Statement Concurrency Control 為了應(yīng)對(duì)突發(fā)的數(shù)據(jù)庫(kù)請(qǐng)求流量、資源消耗過(guò)高的語(yǔ)句訪問(wèn)以及SQL訪問(wèn)模型的變化, 保證實(shí)例持續(xù)穩(wěn)定運(yùn)行,GalaxyEngine 提供基于語(yǔ)句規(guī)則的并發(fā)控制 CCL(Concurrency Control),并提供了工具包(DBMS_CCL)便于您快捷使用。 功能設(shè)計(jì) CCL規(guī)則定義了如下三個(gè)維度的特征: SQL command: SQL命令類(lèi)型,例如SELECT、UPDATE、INSERT、DELETE等。 Object: SQL命令操作的對(duì)象,例如TABLE、VIEW等。 keywords: SQL命令的關(guān)鍵字。 規(guī)則持久化存儲(chǔ)在系統(tǒng)表 mysql.concurrency_control. 接口設(shè)計(jì)
-- ?Add ?Rule dbms_ccl .add_ccl_rule ('' ,'' ,'' ,,'' );-- ?Delete ?Rule dbms_ccl .del_ccl_rule ();-- ?Show ?Rule dbms_ccl .show_ccl_rule ();-- ?Flush ?Rule dbms_ccl .flush_ccl_rule (); 4.5 Statement Outline 生產(chǎn)環(huán)境中,SQL語(yǔ)句的執(zhí)行計(jì)劃經(jīng)常會(huì)發(fā)生改變,導(dǎo)致數(shù)據(jù)庫(kù)不穩(wěn)定。GalaxyStore 利用 Optimizer Hint 和Index Hint 讓 MySQL 穩(wěn)定執(zhí)行計(jì)劃,該方法稱(chēng)為 Statement Outline,并提供了工具包(DBMS_OUTLN)便于快捷使用。 功能設(shè)計(jì)
Statement Outline支持官方MySQL 8.0 的所有 hint 類(lèi)型,分為如下兩類(lèi): Optimizer Hint 根據(jù)作用域和 hint 對(duì)象,分為 Global level hint、Table/Index level hint、Join order hint等。 Index Hint 根據(jù) Index Hint 的類(lèi)型和范圍進(jìn)行分類(lèi)。 增加的 outline 持久化存儲(chǔ)在 mysql. outline 表中。 接口設(shè)計(jì)
-- Add optimizer Outline dbms_outln.add_optimizer_outline('' ,'' ,'' ,'' ,'' ); -- Add Index Outline dbms_outln.add_index_outline('' ,'' ,,'' ,'' ,'' ,'' ); -- Delete Outline dbms_outln.del_outline(); -- Show Outline mysql> call dbms_outln.show_outline(); +------+------------+------------------------------------------------------------------+-----------+-------+------+-------------------------------------------------------+------+----------+-------------------------------------------------------------------------------------+ | ID | SCHEMA | DIGEST | TYPE | SCOPE | POS | HINT | HIT | OVERFLOW | DIGEST_TEXT | +------+------------+------------------------------------------------------------------+-----------+-------+------+-------------------------------------------------------+------+----------+-------------------------------------------------------------------------------------+ | 33 ?| outline_db | 36 bebc61fce7e32b93926aec3fdd790dad5d895107e2d8d3848d1c60b74bcde6 | OPTIMIZER | | 1 ?| /*+ SET_VAR(foreign_key_checks=OFF) */ ????????????????| 1 ?| 0 ?| SELECT * FROM `t1` ?WHERE `id` ?= ? | | 32 ?| outline_db | 36 bebc61fce7e32b93926aec3fdd790dad5d895107e2d8d3848d1c60b74bcde6 | OPTIMIZER | | 1 ?| /*+ MAX_EXECUTION_TIME(1000) */ ???????????????????????| 2 ?| 0 ?| SELECT * FROM `t1` ?WHERE `id` ?= ? | | 34 ?| outline_db | d4dcef634a4a664518e5fb8a21c6ce9b79fccb44b773e86431eb67840975b649 | OPTIMIZER | | 1 ?| /*+ BNL(t1,t2) */ ?????????????????????????????????????| 1 ?| 0 ?| SELECT `t1` ?. `id` ?, `t2` ?. `id` ?FROM `t1` ?, `t2` ???????????????????????????????????| | 35 ?| outline_db | 5 a726a609b6fbfb76bb8f9d2a24af913a2b9d07f015f2ee1f6f2d12dfad72e6f | OPTIMIZER | | 2 ?| /*+ QB_NAME(subq1) */ ????????????????????????????????| 2 ?| 0 ?| SELECT * FROM `t1` ?WHERE `t1` ?. `col1` ?IN ( SELECT `col1` ?FROM `t2` ?) | | 36 ?| outline_db | 5 a726a609b6fbfb76bb8f9d2a24af913a2b9d07f015f2ee1f6f2d12dfad72e6f | OPTIMIZER | | 1 ?| /*+ SEMIJOIN(@subq1 MATERIALIZATION, DUPSWEEDOUT) */ ??| 2 ?| 0 ?| SELECT * FROM `t1` ?WHERE `t1` ?. `col1` ?IN ( SELECT `col1` ?FROM `t2` ?) | | 30 ?| outline_db | b4369611be7ab2d27c85897632576a04bc08f50b928a1d735b62d0a140628c4c | USE INDEX | | 1 ?| ind_1 | 3 ?| 0 ?| SELECT * FROM `t1` ?WHERE `t1` ?. `col1` ?= ? AND `t1` ?. `col2` ?= ? | | 31 ?| outline_db | 33 c71541754093f78a1f2108795cfb45f8b15ec5d6bff76884f4461fb7f33419 | USE INDEX | | 2 ?| ind_2 | 1 ?| 0 ?| SELECT * FROM `t1` ?, `t2` ?WHERE `t1` ?. `col1` ?= `t2` ?. `col1` ?AND `t2` ?. `col2` ?= ? | +------+------------+------------------------------------------------------------------+-----------+-------+------+-------------------------------------------------------+------+----------+-------------------------------------------------------------------------------------+7 ?rows in ?set ?(0.00 ?sec) 4.6 Performance Insight Performance Insight 是專(zhuān)注于實(shí)例負(fù)載監(jiān)控、關(guān)聯(lián)分析、性能調(diào)優(yōu)的利器,幫助您迅速評(píng)估數(shù)據(jù)庫(kù)負(fù)載,找到性能問(wèn)題的源頭,提升數(shù)據(jù)庫(kù)的穩(wěn)定性。 Performance Insight 介紹
Performance Insight由如下兩部分組成: Object statisticsObject statistics查詢(xún)表和索引的統(tǒng)計(jì)信息,包括如下兩個(gè)表: TABLE_STATISTICS:記錄讀取和修改的行。 INDEX_STATISTICS:記錄索引的讀取行。 Performance pointPerformance point 提供實(shí)例的詳細(xì)性能信息,方便您更快更準(zhǔn)確地量化SQL的開(kāi)銷(xiāo)。Performance point包括如下三個(gè)維度: CPU:包括執(zhí)行任務(wù)的總時(shí)間(Elapsed time)、CPU執(zhí)行任務(wù)的時(shí)間(CPU time)等。 LOCK:包括服務(wù)器MDL鎖時(shí)間、存儲(chǔ)事務(wù)鎖時(shí)間、互斥沖突(僅調(diào)試模式)、讀寫(xiě)鎖沖突等。 IO:數(shù)據(jù)文件讀寫(xiě)時(shí)間、日志文件寫(xiě)入時(shí)間、邏輯讀取、物理讀取、物理異步讀取等。 Object statistics 使用方法
確認(rèn)參數(shù) OPT_TABLESTAT 和 OPT_INDEXSTAT 的值為 ON 。示例如下: mysql> show variables like "opt_%_stat" ; ??+---------------+-------+ ??| Variable_name | ?Value | ??+---------------+-------+ ??| ?opt_indexstat | ON | ??| opt_tablestat | ?ON | ??+---------------+-------+ mysql> select * from TABLE_STATISTICS limit 10 ; ??+--------------+--------------+-----------+--------------+------------------------+---------------+--------------+--------------+ ??| TABLE_SCHEMA | ?TABLE_NAME | ROWS_READ | ?ROWS_CHANGED | ROWS_CHANGED_X_INDEXES | ?ROWS_INSERTED | ROWS_DELETED | ?ROWS_UPDATED | ??+--------------+--------------+-----------+--------------+------------------------+---------------+--------------+--------------+ ??| ?mysql | db | ?????????2 ?| 0 | ??????????????????????0 ?| 0 | ????????????0 ?| 0 | ??| mysql | ?engine_cost | 2 | ????????????0 ?| 0 | ?????????????0 ?| 0 | ????????????0 ?| ??| ?mysql | proxies_priv | ?????????1 ?| 0 | ??????????????????????0 ?| 0 | ????????????0 ?| 0 | ??| mysql | ?server_cost | 6 | ????????????0 ?| 0 | ?????????????0 ?| 0 | ????????????0 ?| ??| ?mysql | tables_priv | ?????????2 ?| 0 | ??????????????????????0 ?| 0 | ????????????0 ?| 0 | ??| mysql | ?user | 7 | ????????????0 ?| 0 | ?????????????0 ?| 0 | ????????????0 ?| ??| ?test | sbtest1 | ??????1686 ?| 142 | ????????????????????184 ?| 112 | ???????????12 ?| 18 | ??| test | ?sbtest10 ?????| 1806 | ??????????125 ?| 150 | ???????????105 ?| 5 | ???????????15 ?| ??| ?test | sbtest100 | ??????1623 ?| 141 | ????????????????????182 ?| 110 | ???????????10 ?| 21 | ??| test | ?sbtest11 | 1254 | ??????????136 ?| 172 | ???????????110 ?| 10 | ???????????16 ?| ??+--------------+--------------+-----------+--------------+------------------------+---------------+--------------+--------------+ ??mysql> select * from INDEX_STATISTICS limit 10; ??+--------------+--------------+------------+-----------+ ??| ?TABLE_SCHEMA | TABLE_NAME | ?INDEX_NAME | ROWS_READ | ??+--------------+--------------+------------+-----------+ ??| mysql | ?db | PRIMARY | ?????????2 ?| ??| ?mysql | engine_cost | ?PRIMARY | 2 | ??| mysql | ?proxies_priv | PRIMARY | ?????????1 ?| ??| ?mysql | server_cost | ?PRIMARY | 6 | ??| mysql | ?tables_priv | PRIMARY | ?????????2 ?| ??| ?mysql | user | ?PRIMARY | 7 | ??| test | ?sbtest1 | PRIMARY | ??????2500 ?| ??| ?test | sbtest10 | ?PRIMARY | 3007 | ??| test | ?sbtest100 ????| PRIMARY | ??????2642 ?| ??| ?test | sbtest11 | ?PRIMARY | 2091 | ??+--------------+--------------+------------+-----------+ Performance point 使用方法 Performance point 的相關(guān)參數(shù) mysql> show variables like "%performance_point%" ; ??+---------------------------------------+-------+ ??| Variable_name | ?Value | ??+---------------------------------------+-------+ ??| ?performance_point_dbug_enabled | OFF | ??| performance_point_enabled | ?ON | ??| ?performance_point_iostat_interval | 2 | ??| performance_point_iostat_volume_size | ?10000 ?| ??| ?performance_point_lock_rwlock_enabled | ON | ??+---------------------------------------+-------+ 在 performance_schema 數(shù)據(jù)庫(kù)查詢(xún) events_statements_summary_by_digest_supplement 表 mysql> select * from events_statements_summary_by_digest_supplement limit 10 ; ??+--------------------+----------------------------------+-------------------------------------------+--------------+ ??| SCHEMA_NAME | ?DIGEST | DIGEST_TEXT | ?ELAPSED_TIME | ...... ??+--------------------+----------------------------------+-------------------------------------------+--------------+ ??| ?NULL | 6b787dd1f9c6f6c5033120760a1a82de | ?SELECT @@`version_comment` ?LIMIT ? | 932 | ??| NULL | ?2 fb4341654df6995113d998c52e5abc9 | SHOW SCHEMAS | ?????????2363 ?| ??| ?NULL | 8a93e76a7846384621567fb4daa1bf95 | ?SHOW VARIABLES LIKE ? | 17933 | ??| NULL | ?dd148234ac7a20cb5aee7720fb44b7ea | SELECT SCHEMA ( ) | ?????????1006 ?| ??| ?information_schema | 2fb4341654df6995113d998c52e5abc9 | ?SHOW SCHEMAS | 2156 | ??| information_schema | ?74 af182f3a2bd265678d3dadb53e08da | SHOW TABLES | ?????????3161 ?| ??| ?information_schema | d3a66515192fcb100aaef6f8b6e45603 | ?SELECT * FROM `TABLE_STATISTICS` ?LIMIT ? | 2081 | ??| information_schema | ?b3726b7c4c4db4b309de2dbc45ff52af | SELECT * FROM `INDEX_STATISTICS` LIMIT ? | ?????????2384 ?| ??| ?information_schema | dd148234ac7a20cb5aee7720fb44b7ea | ?SELECT SCHEMA ( ) | 129 | ??| test | ?2 fb4341654df6995113d998c52e5abc9 | SHOW SCHEMAS | ??????????342 ?| ??+--------------------+----------------------------------+-------------------------------------------+--------------+ 注:需要同步打開(kāi) performance schema。 GalaxyEngine 后續(xù)還有更多更廣泛的開(kāi)源和文檔支持計(jì)劃,敬請(qǐng)關(guān)注。 GalaxyEngine 開(kāi)源地址: https://github.com/ApsaraDB/galaxyengine
點(diǎn)擊“閱讀原文”查看 PolarDB-X 更多信息
瀏覽
139
一月天激情综合网
|
超碰在线日本
|
欧美老熟妇乱大交XXXXX
国产伦子伦一级A片在线
|
五月婷婷在线观看
|
www.婷婷综合
|