profiling.result
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· RESULT 代码 · 共 369 行
RESULT
369 行
show profiles;Query_ID Duration Queryshow profile all;Status Duration CPU_user CPU_system Context_voluntary Context_involuntary Block_ops_in Block_ops_out Messages_sent Messages_received Page_faults_major Page_faults_minor Swaps Source_function Source_file Source_lineshow session variables like 'profil%';Variable_name Valueprofiling OFFprofiling_history_size 15select @@profiling;@@profiling0set global profiling = ON;ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBALset global profiling_history_size=100;show global variables like 'profil%';Variable_name Valueprofiling OFFprofiling_history_size 100set session profiling = ON;set session profiling_history_size=30;show session variables like 'profil%';Variable_name Valueprofiling ONprofiling_history_size 30select @@profiling;@@profiling1create table t1 (a int,b int);insert into t1 values (1,1), (2,null), (3, 4);insert into t1 values (5,1), (6,null), (7, 4);insert into t1 values (1,1), (2,null), (3, 4);insert into t1 values (5,1), (6,null), (7, 4);select max(x) from (select sum(a) as x from t1 group by b) as teeone;max(x)20insert into t1 select * from t1;select count(*) from t1;count(*)24insert into t1 select * from t1;insert into t1 select * from t1;insert into t1 select * from t1;select count(*) from t1;count(*)192insert into t1 select * from t1;insert into t1 select * from t1;insert into t1 select * from t1;select count(*) from t1;count(*)1536select sum(a) from t1;sum(a)6144select sum(a) from t1 group by b;sum(a)204815362560select sum(a) + sum(b) from t1 group by b;sum(a) + sum(b)NULL20484608select max(x) from (select sum(a) as x from t1 group by b) as teeone;max(x)2560select '012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890' as big_string;big_string012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890show profiles;Query_ID Duration Query1 # set session profiling_history_size=302 # show session variables like 'profil%'3 # select @@profiling4 # create table t1 (a int,b int)5 # insert into t1 values (1,1), (2,null), (3, 4)6 # insert into t1 values (5,1), (6,null), (7, 4)7 # insert into t1 values (1,1), (2,null), (3, 4)8 # insert into t1 values (5,1), (6,null), (7, 4)9 # select max(x) from (select sum(a) as x from t1 group by b) as teeone10 # insert into t1 select * from t111 # select count(*) from t112 # insert into t1 select * from t113 # insert into t1 select * from t114 # insert into t1 select * from t115 # select count(*) from t116 # insert into t1 select * from t117 # insert into t1 select * from t118 # insert into t1 select * from t119 # select count(*) from t120 # select sum(a) from t121 # select sum(a) from t1 group by b22 # select sum(a) + sum(b) from t1 group by b23 # select max(x) from (select sum(a) as x from t1 group by b) as teeone24 # select '0123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345show profile for query 15;show profile cpu for query 15;show profile cpu, block io for query 15;show profile cpu for query 9 limit 2 offset 2;show profile cpu for query 10 limit 0;show profile cpu for query 65534;show profile memory;show profile block io;show profile context switches;show profile page faults;show profile ipc;show profile swaps limit 1 offset 2;show profile source;show profile all for query 0 limit 0;show profile all for query 15;select * from information_schema.profiling;select query_id, state, duration from information_schema.profiling;select query_id, sum(duration) from information_schema.profiling group by query_id;select query_id, count(*) from information_schema.profiling group by query_id;select sum(duration) from information_schema.profiling;select query_id, count(*), sum(duration) from information_schema.profiling group by query_id;select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling;drop table if exists t1, t2, t3;Warnings:Note 1051 Unknown table 't2'Note 1051 Unknown table 't3'create table t1 (id int );create table t2 (id int not null);create table t3 (id int not null primary key);insert into t1 values (1), (2), (3);insert into t2 values (1), (2), (3);insert into t3 values (1), (2), (3);show profiles;Query_ID Duration Query10 # insert into t1 select * from t111 # select count(*) from t112 # insert into t1 select * from t113 # insert into t1 select * from t114 # insert into t1 select * from t115 # select count(*) from t116 # insert into t1 select * from t117 # insert into t1 select * from t118 # insert into t1 select * from t119 # select count(*) from t120 # select sum(a) from t121 # select sum(a) from t1 group by b22 # select sum(a) + sum(b) from t1 group by b23 # select max(x) from (select sum(a) as x from t1 group by b) as teeone24 # select '012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234525 # select * from information_schema.profiling26 # select query_id, state, duration from information_schema.profiling27 # select query_id, sum(duration) from information_schema.profiling group by query_id28 # select query_id, count(*) from information_schema.profiling group by query_id29 # select sum(duration) from information_schema.profiling30 # select query_id, count(*), sum(duration) from information_schema.profiling group by query_id31 # select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling32 # drop table if exists t1, t2, t333 # SHOW WARNINGS34 # create table t1 (id int )35 # create table t2 (id int not null)36 # create table t3 (id int not null primary key)37 # insert into t1 values (1), (2), (3)38 # insert into t2 values (1), (2), (3)39 # insert into t3 values (1), (2), (3)select * from t1;id123show profiles;Query_ID Duration Query11 # select count(*) from t112 # insert into t1 select * from t113 # insert into t1 select * from t114 # insert into t1 select * from t115 # select count(*) from t116 # insert into t1 select * from t117 # insert into t1 select * from t118 # insert into t1 select * from t119 # select count(*) from t120 # select sum(a) from t121 # select sum(a) from t1 group by b22 # select sum(a) + sum(b) from t1 group by b23 # select max(x) from (select sum(a) as x from t1 group by b) as teeone24 # select '012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234525 # select * from information_schema.profiling26 # select query_id, state, duration from information_schema.profiling27 # select query_id, sum(duration) from information_schema.profiling group by query_id28 # select query_id, count(*) from information_schema.profiling group by query_id29 # select sum(duration) from information_schema.profiling30 # select query_id, count(*), sum(duration) from information_schema.profiling group by query_id31 # select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling32 # drop table if exists t1, t2, t333 # SHOW WARNINGS34 # create table t1 (id int )35 # create table t2 (id int not null)36 # create table t3 (id int not null primary key)37 # insert into t1 values (1), (2), (3)38 # insert into t2 values (1), (2), (3)39 # insert into t3 values (1), (2), (3)40 # select * from t1This ^^ should end in "select * from t1;"delete from t1;insert into t1 values (1), (2), (3);insert into t1 values (1), (2), (3);select * from t1;id123123show profiles;Query_ID Duration Query15 # select count(*) from t116 # insert into t1 select * from t117 # insert into t1 select * from t118 # insert into t1 select * from t119 # select count(*) from t120 # select sum(a) from t121 # select sum(a) from t1 group by b22 # select sum(a) + sum(b) from t1 group by b23 # select max(x) from (select sum(a) as x from t1 group by b) as teeone24 # select '012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234525 # select * from information_schema.profiling26 # select query_id, state, duration from information_schema.profiling27 # select query_id, sum(duration) from information_schema.profiling group by query_id28 # select query_id, count(*) from information_schema.profiling group by query_id29 # select sum(duration) from information_schema.profiling30 # select query_id, count(*), sum(duration) from information_schema.profiling group by query_id31 # select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling32 # drop table if exists t1, t2, t333 # SHOW WARNINGS34 # create table t1 (id int )35 # create table t2 (id int not null)36 # create table t3 (id int not null primary key)37 # insert into t1 values (1), (2), (3)38 # insert into t2 values (1), (2), (3)39 # insert into t3 values (1), (2), (3)40 # select * from t141 # delete from t142 # insert into t1 values (1), (2), (3)43 # insert into t1 values (1), (2), (3)44 # select * from t1set session profiling = OFF;select sum(id) from t1;sum(id)12show profiles;Query_ID Duration Query15 # select count(*) from t116 # insert into t1 select * from t117 # insert into t1 select * from t118 # insert into t1 select * from t119 # select count(*) from t120 # select sum(a) from t121 # select sum(a) from t1 group by b22 # select sum(a) + sum(b) from t1 group by b23 # select max(x) from (select sum(a) as x from t1 group by b) as teeone24 # select '012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234525 # select * from information_schema.profiling26 # select query_id, state, duration from information_schema.profiling27 # select query_id, sum(duration) from information_schema.profiling group by query_id28 # select query_id, count(*) from information_schema.profiling group by query_id29 # select sum(duration) from information_schema.profiling30 # select query_id, count(*), sum(duration) from information_schema.profiling group by query_id31 # select CPU_user, CPU_system, Context_voluntary, Context_involuntary, Block_ops_in, Block_ops_out, Messages_sent, Messages_received, Page_faults_major, Page_faults_minor, Swaps, Source_function, Source_file, Source_line from information_schema.profiling32 # drop table if exists t1, t2, t333 # SHOW WARNINGS34 # create table t1 (id int )35 # create table t2 (id int not null)36 # create table t3 (id int not null primary key)37 # insert into t1 values (1), (2), (3)38 # insert into t2 values (1), (2), (3)39 # insert into t3 values (1), (2), (3)40 # select * from t141 # delete from t142 # insert into t1 values (1), (2), (3)43 # insert into t1 values (1), (2), (3)44 # select * from t1set session profiling = ON;select @@profiling;@@profiling1create function f1() returns varchar(50) return 'hello';select @@profiling;@@profiling1select * from t1 where id <> f1();id123123select @@profiling;@@profiling1set session profiling = ON;drop table if exists t2;create table t2 (id int not null);create trigger t2_bi before insert on t2 for each row set @x=0;select @@profiling;@@profiling1insert into t2 values (1), (2), (3);select @@profiling;@@profiling1set session profiling = ON;drop table if exists t1, t2;create table t1 (id int not null primary key);create table t2 (id int not null primary key, id1 int not null);select @@profiling;@@profiling1alter table t2 add foreign key (id1) references t1 (id) on delete cascade;select @@profiling;@@profiling1lock table t1 write;select @@profiling;@@profiling1unlock table;select @@profiling;@@profiling1set autocommit=0;select @@profiling, @@autocommit;@@profiling @@autocommit1 0begin;select @@profiling;@@profiling1insert into t1 values (1);insert into t2 values (1,1);testing referential integrity cascadedelete from t1 where id = 1;select @@profiling;@@profiling1testing rollbackrollback;select @@profiling;@@profiling1testing commitbegin;select @@profiling;@@profiling1commit;select @@profiling;@@profiling1drop table if exists t1, t2, t3;drop view if exists v1;Warnings:Note 1051 Unknown table 'test.v1'drop function if exists f1;set session profiling = OFF;End of 5.0 tests
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?