Commit fb0ee3ab authored by Alfranio Correia's avatar Alfranio Correia

merge mysql-next-mr --> mysql-5.1-rpl-merge

Conflicts:
  Text conflict in sql/sql_insert.cc 
parents 0f90f1de 9c820e63
#!/bin/sh
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# This script's purpose is to update the automake/autoconf helper scripts and
# to run a plain "configure" without any special compile flags. Only features
......@@ -61,6 +77,7 @@ fi
# Remember that configure restricts the man pages to the configured features !
./configure \
--with-embedded-server \
--with-perfschema \
--with-ndbcluster
$gmake
......@@ -27,7 +27,8 @@ extern char * mysql_unix_port;
CLIENT_TRANSACTIONS | \
CLIENT_PROTOCOL_41 | \
CLIENT_SECURE_CONNECTION | \
CLIENT_MULTI_RESULTS)
CLIENT_MULTI_RESULTS | \
CLIENT_PS_MULTI_RESULTS)
sig_handler my_pipe_sig_handler(int sig);
void read_user_name(char *name);
......
# Copyright (C) 2000-2006 MySQL AB
# Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
......@@ -75,6 +75,8 @@ EXTRA_DIST = README \
# List of directories containing test + result files and the
# related test data files that should be copied
# If you want to add a new suite, please check DEFAULT_SUITES in
# mysql-test-run.pl.
TEST_DIRS = t r include std_data std_data/parts collections \
std_data/ndb_backup50 std_data/ndb_backup51 \
std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \
......@@ -100,7 +102,9 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
suite/parts suite/parts/t suite/parts/r suite/parts/inc \
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r
suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r \
suite/perfschema suite/perfschema/t suite/perfschema/r \
suite/perfschema/include
# Used by dist-hook and install-data-local to copy all
# test files into either dist or install directory
......
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Use default setting for mysqld processes
!include default_mysqld.cnf
!include default_client.cnf
......@@ -9,6 +24,8 @@
log-bin= master-bin
# Run tests with the performance schema instrumentation
loose-enable-performance-schema
[mysqlbinlog]
disable-force-if-open
......
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Default values that applies to all MySQL Servers
[mysqld]
open-files-limit= 1024
......@@ -26,3 +41,6 @@ slave-net-timeout=120
log-bin=mysqld-bin
# Run tests with the performance schema instrumentation
loose-enable-performance-schema
#!/usr/bin/perl
# -*- cperl -*-
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
##############################################################################
#
......@@ -128,7 +143,9 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb";
# If you add a new suite, please check TEST_DIRS in Makefile.am.
#
my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb,perfschema";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
......
......@@ -3,6 +3,7 @@ Database
information_schema
mtr
mysql
performance_schema
test
show tables in mysql;
Tables_in_mysql
......
......@@ -50,6 +50,7 @@ information_schema
mtr
mysql
mysqltest
performance_schema
test
flush tables with read lock;
drop database mysqltest;
......@@ -61,6 +62,7 @@ Database
information_schema
mtr
mysql
performance_schema
test
drop database mysqltest;
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
......
......@@ -11,12 +11,14 @@ select * from information_schema.SCHEMATA where schema_name > 'm';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
def mtr latin1 latin1_swedish_ci NULL
def mysql latin1 latin1_swedish_ci NULL
def performance_schema utf8 utf8_general_ci NULL
def test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata;
schema_name
information_schema
mtr
mysql
performance_schema
test
show databases like 't%';
Database (t%)
......@@ -26,6 +28,7 @@ Database
information_schema
mtr
mysql
performance_schema
test
show databases where `database` = 't%';
Database
......@@ -363,6 +366,7 @@ c
information_schema
mtr
mysql
performance_schema
test
explain select * from v0;
id select_type table type possible_keys key key_len ref rows Extra
......
......@@ -419,6 +419,38 @@ The following options may be given as the first argument:
default}
--partition[=name] Enable or disable partition plugin. Possible values are
ON, OFF, FORCE (don't start if the plugin fails to load).
--performance-schema
Enable the performance schema.
--performance-schema-events-waits-history-long-size=#
Number of rows in EVENTS_WAITS_HISTORY_LONG.
--performance-schema-events-waits-history-size=#
Number of rows per thread in EVENTS_WAITS_HISTORY.
--performance-schema-max-cond-classes=#
Maximum number of condition instruments.
--performance-schema-max-cond-instances=#
Maximum number of instrumented condition objects.
--performance-schema-max-file-classes=#
Maximum number of file instruments.
--performance-schema-max-file-handles=#
Maximum number of opened instrumented files.
--performance-schema-max-file-instances=#
Maximum number of instrumented files.
--performance-schema-max-mutex-classes=#
Maximum number of mutex instruments.
--performance-schema-max-mutex-instances=#
Maximum number of instrumented MUTEX objects.
--performance-schema-max-rwlock-classes=#
Maximum number of rwlock instruments.
--performance-schema-max-rwlock-instances=#
Maximum number of instrumented RWLOCK objects.
--performance-schema-max-table-handles=#
Maximum number of opened instrumented tables.
--performance-schema-max-table-instances=#
Maximum number of instrumented tables.
--performance-schema-max-thread-classes=#
Maximum number of thread instruments.
--performance-schema-max-thread-instances=#
Maximum number of instrumented threads.
--pid-file=name Pid file used by safe_mysqld
--plugin-dir=name Directory for plugins
--plugin-load=name Optional semicolon-separated list of plugins to load,
......@@ -725,7 +757,7 @@ The following options may be given as the first argument:
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
----------------------------------- --------------------------------------
------------------------------------------------- ------------------------
abort-slave-event-count 0
allow-suspicious-udfs FALSE
archive ON
......@@ -862,6 +894,22 @@ optimizer-prune-level 1
optimizer-search-depth 62
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
partition ON
performance-schema FALSE
performance-schema-events-waits-history-long-size 10000
performance-schema-events-waits-history-size 10
performance-schema-max-cond-classes 80
performance-schema-max-cond-instances 1000
performance-schema-max-file-classes 50
performance-schema-max-file-handles 32768
performance-schema-max-file-instances 10000
performance-schema-max-mutex-classes 200
performance-schema-max-mutex-instances 1000
performance-schema-max-rwlock-classes 20
performance-schema-max-rwlock-instances 1000
performance-schema-max-table-handles 100000
performance-schema-max-table-instances 50000
performance-schema-max-thread-classes 50
performance-schema-max-thread-instances 1000
plugin-dir MYSQL_LIBDIR/mysql/plugin
plugin-load (No default value)
port 3306
......
......@@ -419,6 +419,38 @@ The following options may be given as the first argument:
default}
--partition[=name] Enable or disable partition plugin. Possible values are
ON, OFF, FORCE (don't start if the plugin fails to load).
--performance-schema
Enable the performance schema.
--performance-schema-events-waits-history-long-size=#
Number of rows in EVENTS_WAITS_HISTORY_LONG.
--performance-schema-events-waits-history-size=#
Number of rows per thread in EVENTS_WAITS_HISTORY.
--performance-schema-max-cond-classes=#
Maximum number of condition instruments.
--performance-schema-max-cond-instances=#
Maximum number of instrumented condition objects.
--performance-schema-max-file-classes=#
Maximum number of file instruments.
--performance-schema-max-file-handles=#
Maximum number of opened instrumented files.
--performance-schema-max-file-instances=#
Maximum number of instrumented files.
--performance-schema-max-mutex-classes=#
Maximum number of mutex instruments.
--performance-schema-max-mutex-instances=#
Maximum number of instrumented MUTEX objects.
--performance-schema-max-rwlock-classes=#
Maximum number of rwlock instruments.
--performance-schema-max-rwlock-instances=#
Maximum number of instrumented RWLOCK objects.
--performance-schema-max-table-handles=#
Maximum number of opened instrumented tables.
--performance-schema-max-table-instances=#
Maximum number of instrumented tables.
--performance-schema-max-thread-classes=#
Maximum number of thread instruments.
--performance-schema-max-thread-instances=#
Maximum number of instrumented threads.
--pid-file=name Pid file used by safe_mysqld
--plugin-dir=name Directory for plugins
--plugin-load=name Optional semicolon-separated list of plugins to load,
......@@ -729,7 +761,7 @@ The following options may be given as the first argument:
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
------------------------------------------------- ------------------------
abort-slave-event-count 0
allow-suspicious-udfs FALSE
archive ON
......@@ -866,6 +898,22 @@ optimizer-prune-level 1
optimizer-search-depth 62
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
partition ON
performance-schema FALSE
performance-schema-events-waits-history-long-size 10000
performance-schema-events-waits-history-size 10
performance-schema-max-cond-classes 80
performance-schema-max-cond-instances 1000
performance-schema-max-file-classes 50
performance-schema-max-file-handles 32768
performance-schema-max-file-instances 10000
performance-schema-max-mutex-classes 200
performance-schema-max-mutex-instances 1000
performance-schema-max-rwlock-classes 20
performance-schema-max-rwlock-instances 1000
performance-schema-max-table-handles 100000
performance-schema-max-table-instances 50000
performance-schema-max-thread-classes 50
performance-schema-max-thread-instances 1000
plugin-dir MYSQL_LIBDIR/plugin
plugin-load (No default value)
port 3306
......@@ -945,6 +993,7 @@ use-symbolic-links FALSE
verbose TRUE
wait-timeout 28800
warnings 1
>>>>>>> MERGE-SOURCE
To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.
......@@ -262,6 +262,7 @@ Database
information_schema
mtr
mysql
performance_schema
test
prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4;
......
......@@ -9,5 +9,6 @@ information_schema
foo
mtr
mysql
performance_schema
test
drop schema foo;
......@@ -142,6 +142,7 @@ Database
information_schema
mtr
mysql
performance_schema
test
show databases like "test%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
......
......@@ -124,4 +124,5 @@ Database
information_schema
mtr
mysql
performance_schema
test
......@@ -56,6 +56,7 @@ catalog_name schema_name sql_path
def information_schema NULL
def mtr NULL
def mysql NULL
def performance_schema NULL
def test NULL
###############################################################################
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
......
......@@ -13,6 +13,7 @@ information_schema
日本語
ニホンゴ
mysql
performance_schema
test
USE `ニホンゴ`;
USE `日本語`;
......
......@@ -14,6 +14,7 @@ information_schema
龔龖龗
ニホンゴ
mysql
performance_schema
test
USE `ニホンゴ`;
USE `日本語`;
......
......@@ -13,6 +13,7 @@ information_schema
龔龖龗
ニホンゴ
mysql
performance_schema
test
USE `ニホンゴ`;
USE `日本語`;
......
......@@ -13,6 +13,7 @@ information_schema
龔龖龗
ニホンゴ
mysql
performance_schema
test
USE `ニホンゴ`;
USE `日本語`;
......
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
RESET MASTER;
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%";
select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
--disable_warnings
drop table if exists test.t1;
drop table if exists test.t2;
--enable_warnings
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
drop table test.t1;
drop table test.t2;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%";
--source include/show_binlog_events.inc
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
disconnect con1;
disconnect con2;
disconnect con3;
connection default;
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
--disable_warnings
drop table if exists test.t1;
--enable_warnings
## The result of show grants is not consistent across platforms ...
## show grants;
## Not enforced yet: deny CREATE_ACL and DROP_ACL
## Waiting to remove .FRM files first
##
## --error ER_DBACCESS_DENIED_ERROR
## create table performance_schema.t1(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
## drop table performance_schema.t1;
##
## --error ER_DBACCESS_DENIED_ERROR
## create table performance_schema.SETUP_INSTRUMENTS(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
## create table performance_schema.EVENTS_WAITS_CURRENT(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
## create table performance_schema.FILE_INSTANCES(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
## drop table performance_schema.SETUP_INSTRUMENTS;
##
## --error ER_DBACCESS_DENIED_ERROR
## drop table performance_schema.EVENTS_WAITS_CURRENT;
##
## --error ER_DBACCESS_DENIED_ERROR
## drop table performance_schema.FILE_INSTANCES;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.SETUP_INSTRUMENTS to test.t1;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.FILE_INSTANCES to test.t1;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.FILE_INSTANCES to performance_schema.t1;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.SETUP_INSTRUMENTS
to performance_schema.EVENTS_WAITS_CURRENT;
--error ER_DBACCESS_DENIED_ERROR
rename table performance_schema.EVENTS_WAITS_CURRENT
to performance_schema.SETUP_INSTRUMENTS;
--error ER_DBACCESS_DENIED_ERROR
create procedure performance_schema.my_proc() begin end;
--error ER_DBACCESS_DENIED_ERROR
create function performance_schema.my_func() returns int return 0;
--error ER_DBACCESS_DENIED_ERROR
create event performance_schema.my_event on schedule every 15 minute
do begin end;
--error ER_DBACCESS_DENIED_ERROR
create trigger performance_schema.bi_setup_instruments
before insert on performance_schema.SETUP_INSTRUMENTS
for each row begin end;
--error ER_DBACCESS_DENIED_ERROR
create trigger performance_schema.bi_events_waits_current
before insert on performance_schema.EVENTS_WAITS_CURRENT
for each row begin end;
--error ER_DBACCESS_DENIED_ERROR
create trigger performance_schema.bi_file_instances
before insert on performance_schema.FILE_INSTANCES
for each row begin end;
--error ER_WRONG_PERFSCHEMA_USAGE
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
--error ER_WRONG_PERFSCHEMA_USAGE
create table test.t1 like performance_schema.SETUP_INSTRUMENTS;
--error ER_WRONG_PERFSCHEMA_USAGE
create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
--error ER_WRONG_PERFSCHEMA_USAGE
create table test.t1 like performance_schema.FILE_INSTANCES;
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.SETUP_INSTRUMENTS
set name="foo";
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.EVENTS_WAITS_CURRENT
set name="foo";
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.FILE_INSTANCES
set name="foo";
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_INSTRUMENTS;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_CURRENT;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_INSTANCES;
lock table performance_schema.SETUP_INSTRUMENTS read;
unlock tables;
lock table performance_schema.SETUP_INSTRUMENTS write;
unlock tables;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
lock table performance_schema.EVENTS_WAITS_CURRENT read;
unlock tables;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
lock table performance_schema.EVENTS_WAITS_CURRENT write;
unlock tables;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
lock table performance_schema.FILE_INSTANCES read;
unlock tables;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
lock table performance_schema.FILE_INSTANCES write;
unlock tables;
--echo #
--echo # WL#4818, NFS2: Can use grants to give normal user access
--echo # to view data from _CURRENT and _HISTORY tables
--echo #
--echo # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
--echo # (Except for EVENTS_WAITS_CURRENT, which is granted.)
# Errors here will be caught by the diff afterwards
--disable_abort_on_error
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1;
--enable_abort_on_error
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQLD_TMPDIR= `select @@tmpdir`;
--disable_query_log
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_CONSUMERS set enabled='YES';
--enable_query_log
connect (con1, localhost, root, , );
let $con1_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
where ID in (select connection_id())`;
connect (con2, localhost, root, , );
let $con2_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
where ID in (select connection_id())`;
connect (con3, localhost, root, , );
let $con3_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
where ID in (select connection_id())`;
connection default;
--disable_query_log
prepare stmt_dump_events from
"select event_name,
left(source, locate(\":\", source)) as short_source,
operation, number_of_bytes
from performance_schema.EVENTS_WAITS_HISTORY_LONG
where thread_id=? order by event_id;";
prepare stmt_dump_thread from
"select name from performance_schema.PROCESSLIST where thread_id=? ;";
--enable_query_log
# Copyright (C) 2008-2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
show databases;
select count(*) from performance_schema.PERFORMANCE_TIMERS;
select count(*) from performance_schema.SETUP_CONSUMERS;
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
select count(*) from performance_schema.SETUP_TIMERS;
# Make sure we don't crash, no matter what the starting parameters are
--disable_result_log
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
--enable_result_log
# This has a stable output, printing the result:
show variables like "performance_schema%";
# This has an unrepeatable output, it does depends too much on
# - the platform hardware (sizeof structures, padding)
# - the compiler used (sizeof(enum))
# - the platform header files (sizeof(size_t))
# - the code path in the server (what gets executed and instrumented
# at runtime)
--disable_result_log
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
--enable_result_log
"General cleanup"
drop table if exists t1;
update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO';
update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
update performance_schema.SETUP_INSTRUMENTS
set enabled = 'YES', timed = 'YES';
create table t1 (
id INT PRIMARY KEY,
b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO';
set @dump_all=FALSE;
"Verifying file aggregate consistency"
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
EVENT_NAME SUM_NUMBER_OF_BYTES_READ SUM(i.SUM_NUMBER_OF_BYTES_READ)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
OR @dump_all;
EVENT_NAME SUM_NUMBER_OF_BYTES_WRITE SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
"Verifying waits aggregate consistency (instance)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT <> SUM(i.SUM_TIMER_WAIT))
OR @dump_all;
EVENT_NAME SUM_TIMER_WAIT SUM(i.SUM_TIMER_WAIT)
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT <> MIN(i.MIN_TIMER_WAIT))
AND (MIN(i.MIN_TIMER_WAIT) != 0)
OR @dump_all;
EVENT_NAME MIN_TIMER_WAIT MIN(i.MIN_TIMER_WAIT)
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT <> MAX(i.MAX_TIMER_WAIT))
OR @dump_all;
EVENT_NAME MAX_TIMER_WAIT MAX(i.MAX_TIMER_WAIT)
"Verifying waits aggregate consistency (thread)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT))
OR @dump_all;
EVENT_NAME SUM_TIMER_WAIT SUM(t.SUM_TIMER_WAIT)
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT))
AND (MIN(t.MIN_TIMER_WAIT) != 0)
OR @dump_all;
EVENT_NAME MIN_TIMER_WAIT MIN(t.MIN_TIMER_WAIT)
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT))
OR @dump_all;
EVENT_NAME MAX_TIMER_WAIT MAX(t.MAX_TIMER_WAIT)
update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
update performance_schema.SETUP_INSTRUMENTS
set enabled = 'YES', timed = 'YES';
drop table test.t1;
Found: unknown variable 'performance-schema-enabled=maybe'
Found: Aborting
Found: ambiguous option '--performance-schema-max_=12'
set binlog_format=mixed;
RESET MASTER;
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%";
select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
count(*) > 0
1
drop table if exists test.t1;
drop table if exists test.t2;
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
drop table test.t1;
drop table test.t2;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%";
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table if exists test.t1
master-bin.000001 # Query # # use `test`; drop table if exists test.t2
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128))
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table test.t1
master-bin.000001 # Query # # use `test`; drop table test.t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
set binlog_format=row;
RESET MASTER;
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%";
select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
count(*) > 0
1
drop table if exists test.t1;
drop table if exists test.t2;
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
drop table test.t1;
drop table test.t2;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%";
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table if exists test.t1
master-bin.000001 # Query # # use `test`; drop table if exists test.t2
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128))
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table test.t1
master-bin.000001 # Query # # use `test`; drop table test.t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
set binlog_format=statement;
RESET MASTER;
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%";
Warnings:
Note 1592 Statement may not be safe to log in statement format.
select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
count(*) > 0
1
drop table if exists test.t1;
drop table if exists test.t2;
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
Warnings:
Note 1592 Statement may not be safe to log in statement format.
insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
Warnings:
Note 1592 Statement may not be safe to log in statement format.
drop table test.t1;
drop table test.t2;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%";
Warnings:
Note 1592 Statement may not be safe to log in statement format.
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
where name like "wait/synch/rwlock/%"
master-bin.000001 # Query # # use `test`; drop table if exists test.t1
master-bin.000001 # Query # # use `test`; drop table if exists test.t2
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128))
master-bin.000001 # Query # # use `test`; insert into test.t1
select thread_id from performance_schema.EVENTS_WAITS_CURRENT
master-bin.000001 # Query # # use `test`; insert into test.t2
select name from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%"
master-bin.000001 # Query # # use `test`; drop table test.t1
master-bin.000001 # Query # # use `test`; drop table test.t2
master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/rwlock/%"
show variables like 'performance_schema_max_thread_classes';
Variable_name Value
performance_schema_max_thread_classes 12
show variables like 'performance_schema_max_thread_instances';
Variable_name Value
performance_schema_max_thread_instances 318
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
grant SELECT(thread_id, event_id) on performance_schema.EVENTS_WAITS_CURRENT
to 'pfs_user_5'@localhost;
grant UPDATE(enabled) on performance_schema.SETUP_INSTRUMENTS
to 'pfs_user_5'@localhost;
flush privileges;
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
select thread_id, event_id from performance_schema.EVENTS_WAITS_CURRENT;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
select event_name from performance_schema.EVENTS_WAITS_CURRENT;
ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'EVENTS_WAITS_CURRENT'
select thread_id, event_id, event_name
from performance_schema.EVENTS_WAITS_CURRENT;
ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'EVENTS_WAITS_CURRENT'
update performance_schema.SETUP_INSTRUMENTS set name='illegal';
ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'name' in table 'SETUP_INSTRUMENTS'
update performance_schema.SETUP_INSTRUMENTS set timed='NO';
ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'timed' in table 'SETUP_INSTRUMENTS'
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';
alter table performance_schema.COND_INSTANCES add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.COND_INSTANCES;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.COND_INSTANCES ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.COND_INSTANCES(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.EVENTS_WAITS_CURRENT add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.EVENTS_WAITS_CURRENT;
ALTER TABLE performance_schema.EVENTS_WAITS_CURRENT ADD INDEX test_index(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_CURRENT(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.EVENTS_WAITS_HISTORY add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.EVENTS_WAITS_HISTORY;
ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY ADD INDEX test_index(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.EVENTS_WAITS_HISTORY_LONG add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG ADD INDEX test_index(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY_LONG(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE ADD INDEX test_index(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME ADD INDEX test_index(THREAD_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(THREAD_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.FILE_INSTANCES add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.FILE_INSTANCES;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.FILE_INSTANCES ADD INDEX test_index(FILE_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.FILE_INSTANCES(FILE_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
ALTER TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_EVENT_NAME(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
ALTER TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_INSTANCE(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.MUTEX_INSTANCES add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.MUTEX_INSTANCES;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.MUTEX_INSTANCES ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.MUTEX_INSTANCES(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.PERFORMANCE_TIMERS add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.PERFORMANCE_TIMERS;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.PERFORMANCE_TIMERS ADD INDEX test_index(TIMER_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.PERFORMANCE_TIMERS(TIMER_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.PROCESSLIST add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.PROCESSLIST;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.PROCESSLIST ADD INDEX test_index(ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.PROCESSLIST(ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.RWLOCK_INSTANCES add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.RWLOCK_INSTANCES;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.RWLOCK_INSTANCES ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.RWLOCK_INSTANCES(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.SETUP_CONSUMERS add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.SETUP_CONSUMERS;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.SETUP_CONSUMERS ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_CONSUMERS(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.SETUP_INSTRUMENTS add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.SETUP_INSTRUMENTS;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.SETUP_INSTRUMENTS ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_INSTRUMENTS(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.SETUP_OBJECTS add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.SETUP_OBJECTS;
ALTER TABLE performance_schema.SETUP_OBJECTS ADD INDEX test_index(OBJECT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_OBJECTS(OBJECT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
alter table performance_schema.SETUP_TIMERS add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.SETUP_TIMERS;
ERROR HY000: Invalid performance_schema usage.
ALTER TABLE performance_schema.SETUP_TIMERS ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_TIMERS(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
select * from performance_schema.COND_INSTANCES limit 1;
NAME OBJECT_INSTANCE_BEGIN
# #
select * from performance_schema.COND_INSTANCES
where name='FOO';
NAME OBJECT_INSTANCE_BEGIN
insert into performance_schema.COND_INSTANCES
set name='FOO', object_instance_begin=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
update performance_schema.COND_INSTANCES
set name='FOO';
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
delete from performance_schema.COND_INSTANCES
where name like "wait/%";
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
delete from performance_schema.COND_INSTANCES;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
LOCK TABLES performance_schema.COND_INSTANCES READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
UNLOCK TABLES;
LOCK TABLES performance_schema.COND_INSTANCES WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
UNLOCK TABLES;
select * from performance_schema.EVENTS_WAITS_CURRENT
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.EVENTS_WAITS_CURRENT
where event_name='FOO';
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
insert into performance_schema.EVENTS_WAITS_CURRENT
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
update performance_schema.EVENTS_WAITS_CURRENT
set timer_start=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
update performance_schema.EVENTS_WAITS_CURRENT
set timer_start=12 where thread_id=0;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
delete from performance_schema.EVENTS_WAITS_CURRENT
where thread_id=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
delete from performance_schema.EVENTS_WAITS_CURRENT;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
UNLOCK TABLES;
LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
UNLOCK TABLES;
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name='FOO';
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
insert into performance_schema.EVENTS_WAITS_HISTORY
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
update performance_schema.EVENTS_WAITS_HISTORY
set timer_start=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
update performance_schema.EVENTS_WAITS_HISTORY
set timer_start=12 where thread_id=0;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
delete from performance_schema.EVENTS_WAITS_HISTORY
where thread_id=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
delete from performance_schema.EVENTS_WAITS_HISTORY;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
UNLOCK TABLES;
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
UNLOCK TABLES;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name='FOO';
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
insert into performance_schema.EVENTS_WAITS_HISTORY_LONG
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
update performance_schema.EVENTS_WAITS_HISTORY_LONG
set timer_start=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
update performance_schema.EVENTS_WAITS_HISTORY_LONG
set timer_start=12 where thread_id=0;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
delete from performance_schema.EVENTS_WAITS_HISTORY_LONG
where thread_id=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
delete from performance_schema.EVENTS_WAITS_HISTORY_LONG;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
UNLOCK TABLES;
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
UNLOCK TABLES;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
where event_name like 'Wait/Synch/%' limit 1;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
where event_name='FOO';
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
set count_star=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
set count_star=12 where event_name like "FOO";
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
where count_star=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
UNLOCK TABLES;
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
UNLOCK TABLES;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where event_name like 'Wait/Synch/%' limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where event_name='FOO';
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
order by count_star limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
order by count_star desc limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where min_timer_wait > 0 order by count_star limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where min_timer_wait > 0 order by count_star desc limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
set event_name='FOO', object_instance_begin=0,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
set count_star=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
set count_star=12 where event_name like "FOO";
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where count_star=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
UNLOCK TABLES;
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
UNLOCK TABLES;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
where event_name='FOO';
THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
set event_name='FOO', thread_id=1,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
set count_star=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
set count_star=12 where event_name like "FOO";
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
where count_star=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
UNLOCK TABLES;
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
UNLOCK TABLES;
select * from performance_schema.FILE_INSTANCES limit 1;
FILE_NAME EVENT_NAME OPEN_COUNT
# # #
select * from performance_schema.FILE_INSTANCES
where file_name='FOO';
FILE_NAME EVENT_NAME OPEN_COUNT
insert into performance_schema.FILE_INSTANCES
set file_name='FOO', event_name='BAR', open_count=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
update performance_schema.FILE_INSTANCES
set file_name='FOO';
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
delete from performance_schema.FILE_INSTANCES
where event_name like "wait/%";
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
delete from performance_schema.FILE_INSTANCES;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
LOCK TABLES performance_schema.FILE_INSTANCES READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
UNLOCK TABLES;
LOCK TABLES performance_schema.FILE_INSTANCES WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
UNLOCK TABLES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
where event_name like 'Wait/io/%' limit 1;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
# # # # #
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
where event_name='FOO';
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
insert into performance_schema.FILE_SUMMARY_BY_EVENT_NAME
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
set count_read=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
set count_write=12 where event_name like "FOO";
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
where count_read=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
UNLOCK TABLES;
LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
UNLOCK TABLES;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
where event_name like 'Wait/io/%' limit 1;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
# # # # # #
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
where event_name='FOO';
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
insert into performance_schema.FILE_SUMMARY_BY_INSTANCE
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
update performance_schema.FILE_SUMMARY_BY_INSTANCE
set count_read=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
update performance_schema.FILE_SUMMARY_BY_INSTANCE
set count_write=12 where event_name like "FOO";
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
delete from performance_schema.FILE_SUMMARY_BY_INSTANCE
where count_read=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
delete from performance_schema.FILE_SUMMARY_BY_INSTANCE;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
UNLOCK TABLES;
LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
UNLOCK TABLES;
select * from performance_schema.MUTEX_INSTANCES limit 1;
NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
# # NULL
select * from performance_schema.MUTEX_INSTANCES
where name='FOO';
NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
insert into performance_schema.MUTEX_INSTANCES
set name='FOO', object_instance_begin=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
update performance_schema.MUTEX_INSTANCES
set name='FOO';
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
delete from performance_schema.MUTEX_INSTANCES
where name like "wait/%";
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
delete from performance_schema.MUTEX_INSTANCES;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
LOCK TABLES performance_schema.MUTEX_INSTANCES READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
UNLOCK TABLES;
LOCK TABLES performance_schema.MUTEX_INSTANCES WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
UNLOCK TABLES;
select * from performance_schema.PERFORMANCE_TIMERS;
TIMER_NAME TIMER_FREQUENCY TIMER_RESOLUTION TIMER_OVERHEAD
CYCLE <frequency> <resolution> <overhead>
NANOSECOND <frequency> <resolution> <overhead>
MICROSECOND <frequency> <resolution> <overhead>
MILLISECOND <frequency> <resolution> <overhead>
TICK <frequency> <resolution> <overhead>
select * from performance_schema.PERFORMANCE_TIMERS
where timer_name='CYCLE';
TIMER_NAME TIMER_FREQUENCY TIMER_RESOLUTION TIMER_OVERHEAD
CYCLE <frequency> <resolution> <overhead>
insert into performance_schema.PERFORMANCE_TIMERS
set timer_name='FOO', timer_frequency=1,
timer_resolution=2, timer_overhead=3;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
update performance_schema.PERFORMANCE_TIMERS
set timer_frequency=12 where timer_name='CYCLE';
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
delete from performance_schema.PERFORMANCE_TIMERS;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
delete from performance_schema.PERFORMANCE_TIMERS
where timer_name='CYCLE';
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
LOCK TABLES performance_schema.PERFORMANCE_TIMERS READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
UNLOCK TABLES;
LOCK TABLES performance_schema.PERFORMANCE_TIMERS WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
UNLOCK TABLES;
select * from performance_schema.PROCESSLIST
where name like 'Thread/%' limit 1;
THREAD_ID ID NAME
# # #
select * from performance_schema.PROCESSLIST
where name='FOO';
THREAD_ID ID NAME
insert into performance_schema.PROCESSLIST
set name='FOO', thread_id=1, id=2;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'PROCESSLIST'
update performance_schema.PROCESSLIST
set thread_id=12;
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
update performance_schema.PROCESSLIST
set thread_id=12 where name like "FOO";
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
delete from performance_schema.PROCESSLIST
where id=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
delete from performance_schema.PROCESSLIST;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
LOCK TABLES performance_schema.PROCESSLIST READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PROCESSLIST'
UNLOCK TABLES;
LOCK TABLES performance_schema.PROCESSLIST WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PROCESSLIST'
UNLOCK TABLES;
select * from performance_schema.RWLOCK_INSTANCES limit 1;
NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
# # NULL 0
select * from performance_schema.RWLOCK_INSTANCES
where name='FOO';
NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
insert into performance_schema.RWLOCK_INSTANCES
set name='FOO', object_instance_begin=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
update performance_schema.RWLOCK_INSTANCES
set name='FOO';
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
delete from performance_schema.RWLOCK_INSTANCES
where name like "wait/%";
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
delete from performance_schema.RWLOCK_INSTANCES;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
LOCK TABLES performance_schema.RWLOCK_INSTANCES READ;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
UNLOCK TABLES;
LOCK TABLES performance_schema.RWLOCK_INSTANCES WRITE;
ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
UNLOCK TABLES;
select * from performance_schema.SETUP_CONSUMERS;
NAME ENABLED
events_waits_current YES
events_waits_history YES
events_waits_history_long YES
events_waits_summary_by_thread_by_event_name YES
events_waits_summary_by_event_name YES
events_waits_summary_by_instance YES
file_summary_by_event_name YES
file_summary_by_instance YES
select * from performance_schema.SETUP_CONSUMERS
where name='events_waits_current';
NAME ENABLED
events_waits_current YES
select * from performance_schema.SETUP_CONSUMERS
where enabled='YES';
NAME ENABLED
events_waits_current YES
events_waits_history YES
events_waits_history_long YES
events_waits_summary_by_thread_by_event_name YES
events_waits_summary_by_event_name YES
events_waits_summary_by_instance YES
file_summary_by_event_name YES
file_summary_by_instance YES
select * from performance_schema.SETUP_CONSUMERS
where enabled='NO';
NAME ENABLED
insert into performance_schema.SETUP_CONSUMERS
set name='FOO', enabled='YES';
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS'
update performance_schema.SETUP_CONSUMERS
set name='FOO';
ERROR HY000: Invalid performance_schema usage.
update performance_schema.SETUP_CONSUMERS
set enabled='YES';
delete from performance_schema.SETUP_CONSUMERS;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS'
delete from performance_schema.SETUP_CONSUMERS
where name='events_waits_current';
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS'
LOCK TABLES performance_schema.SETUP_CONSUMERS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_CONSUMERS WRITE;
UNLOCK TABLES;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Mutex/sql/%'
and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
order by name limit 10;
NAME ENABLED TIMED
wait/synch/mutex/sql/Cversion_lock YES YES
wait/synch/mutex/sql/Delayed_insert::mutex YES YES
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state YES YES
wait/synch/mutex/sql/hash_filo::lock YES YES
wait/synch/mutex/sql/LOCK_active_mi YES YES
wait/synch/mutex/sql/LOCK_connection_count YES YES
wait/synch/mutex/sql/LOCK_crypt YES YES
wait/synch/mutex/sql/LOCK_delayed_create YES YES
wait/synch/mutex/sql/LOCK_delayed_insert YES YES
wait/synch/mutex/sql/LOCK_delayed_status YES YES
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Rwlock/sql/%'
order by name limit 10;
NAME ENABLED TIMED
wait/synch/rwlock/sql/LOCK_dboptions YES YES
wait/synch/rwlock/sql/LOCK_grant YES YES
wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES
wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES
wait/synch/rwlock/sql/LOGGER::LOCK_logger YES YES
wait/synch/rwlock/sql/Query_cache_query::lock YES YES
wait/synch/rwlock/sql/THR_LOCK_servers YES YES
wait/synch/rwlock/sql/THR_LOCK_udf YES YES
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
'wait/synch/cond/sql/COND_handler_count',
'wait/synch/cond/sql/DEBUG_SYNC::cond')
order by name limit 10;
NAME ENABLED TIMED
wait/synch/cond/sql/COND_flush_thread_cache YES YES
wait/synch/cond/sql/COND_global_read_lock YES YES
wait/synch/cond/sql/COND_manager YES YES
wait/synch/cond/sql/COND_queue_state YES YES
wait/synch/cond/sql/COND_refresh YES YES
wait/synch/cond/sql/COND_rpl_status YES YES
wait/synch/cond/sql/COND_server_started YES YES
wait/synch/cond/sql/COND_thread_cache YES YES
wait/synch/cond/sql/COND_thread_count YES YES
wait/synch/cond/sql/Delayed_insert::cond YES YES
select * from performance_schema.SETUP_INSTRUMENTS
where name='Wait';
select * from performance_schema.SETUP_INSTRUMENTS
where enabled='YES';
insert into performance_schema.SETUP_INSTRUMENTS
set name='FOO', enabled='YES', timed='YES';
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
update performance_schema.SETUP_INSTRUMENTS
set name='FOO';
ERROR HY000: Invalid performance_schema usage.
update performance_schema.SETUP_INSTRUMENTS
set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS
set timed='NO';
select * from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS
set enabled='YES', timed='YES';
delete from performance_schema.SETUP_INSTRUMENTS;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
delete from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/%';
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
LOCK TABLES performance_schema.SETUP_INSTRUMENTS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_INSTRUMENTS WRITE;
UNLOCK TABLES;
select * from performance_schema.SETUP_OBJECTS;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED
select * from performance_schema.SETUP_OBJECTS
where object_type = 'TABLE';
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED
select * from performance_schema.SETUP_OBJECTS
where enabled='YES';
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED
insert into performance_schema.SETUP_OBJECTS
set object_type='TABLE', object_schema='FOO', object_name='BAR',
enabled='YES', timed='YES', aggregated='YES';
ERROR HY000: Table storage engine for 'SETUP_OBJECTS' doesn't have this option
update performance_schema.SETUP_OBJECTS
set object_type='TABLE';
update performance_schema.SETUP_OBJECTS
set object_schema='ILLEGAL';
update performance_schema.SETUP_OBJECTS
set object_name='ILLEGAL';
update performance_schema.SETUP_OBJECTS
set enabled='NO';
update performance_schema.SETUP_OBJECTS
set timed='NO';
update performance_schema.SETUP_OBJECTS
set aggregated='NO';
select * from performance_schema.SETUP_OBJECTS;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED
update performance_schema.SETUP_OBJECTS
set enabled='YES', timed='YES', aggregated='YES';
delete from performance_schema.SETUP_OBJECTS
where object_type = 'TABLE';
delete from performance_schema.SETUP_OBJECTS;
LOCK TABLES performance_schema.SETUP_OBJECTS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_OBJECTS WRITE;
UNLOCK TABLES;
select * from performance_schema.SETUP_TIMERS;
NAME TIMER_NAME
wait CYCLE
select * from performance_schema.SETUP_TIMERS
where name='Wait';
NAME TIMER_NAME
wait CYCLE
select * from performance_schema.SETUP_TIMERS
where timer_name='CYCLE';
NAME TIMER_NAME
wait CYCLE
insert into performance_schema.SETUP_TIMERS
set name='FOO', timer_name='CYCLE';
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_TIMERS'
update performance_schema.SETUP_TIMERS
set name='FOO';
ERROR HY000: Invalid performance_schema usage.
update performance_schema.SETUP_TIMERS
set timer_name='MILLISECOND';
select * from performance_schema.SETUP_TIMERS;
NAME TIMER_NAME
wait MILLISECOND
update performance_schema.SETUP_TIMERS
set timer_name='CYCLE';
delete from performance_schema.SETUP_TIMERS;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_TIMERS'
delete from performance_schema.SETUP_TIMERS
where name='Wait';
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_TIMERS'
LOCK TABLES performance_schema.SETUP_TIMERS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_TIMERS WRITE;
UNLOCK TABLES;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD'));
SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation;
has_instrumentation
Success
SELECT * FROM t1 WHERE id < 4;
id b
1 initial value
2 initial value
3 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed;
test_ff1_timed
Success
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled='NO';
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2));
SELECT * FROM t1 WHERE id < 6;
id b
1 initial value
2 initial value
3 initial value
4 initial value
5 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed;
test_ff2_timed
Success
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'NO';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id > 4;
id b
5 initial value
6 initial value
7 initial value
8 initial value
SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'YES';
SELECT * FROM t1 WHERE id < 4;
id b
1 initial value
2 initial value
3 initial value
DROP TABLE t1;
SELECT SUM(COUNT_READ) AS sum_count_read,
SUM(COUNT_WRITE) AS sum_count_write,
SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read,
SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write
FROM performance_schema.FILE_SUMMARY_BY_INSTANCE
WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL;
SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
WHERE COUNT_STAR > 0
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;
SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
GROUP BY i.user
ORDER BY SUM_WAIT DESC
LIMIT 20;
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
WHERE p.ID = 1
GROUP BY h.EVENT_NAME
HAVING TOTAL_WAIT > 0;
SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
GROUP BY i.user, h.operation
HAVING BYTES > 0
ORDER BY i.user, h.operation;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
id b
1 initial value
2 initial value
3 initial value
4 initial value
5 initial value
6 initial value
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed;
test_fm1_timed
Success
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
WHERE NAME = 'wait/synch/mutex/sql/LOCK_open';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
id b
1 initial value
2 initial value
3 initial value
4 initial value
5 initial value
6 initial value
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed;
test_fm2_timed
Success
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
id b
1 initial value
2 initial value
3 initial value
4 initial value
5 initial value
6 initial value
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed;
test_fm1_rw_timed
Success
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
id b
1 initial value
2 initial value
3 initial value
4 initial value
5 initial value
6 initial value
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed;
test_fm2_rw_timed
Success
DROP TABLE t1;
use performance_schema;
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
connect (con1, localhost, pfsuser, , test);
lock tables performance_schema.SETUP_INSTRUMENTS read;
select * from performance_schema.SETUP_INSTRUMENTS;
unlock tables;
lock tables performance_schema.SETUP_INSTRUMENTS write;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
unlock tables;
connection default;
flush tables with read lock;
connection con1;
lock tables performance_schema.SETUP_INSTRUMENTS read;
select * from performance_schema.SETUP_INSTRUMENTS;
unlock tables;
lock tables performance_schema.SETUP_INSTRUMENTS write;
connection default;
select event_name,
left(source, locate(":", source)) as short_source,
timer_end, timer_wait, operation
from performance_schema.EVENTS_WAITS_CURRENT
where event_name like "wait/synch/cond/sql/COND_global_read_lock";
event_name short_source timer_end timer_wait operation
wait/synch/cond/sql/COND_global_read_lock lock.cc: NULL NULL wait
unlock tables;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
unlock tables;
connection default;
drop user pfsuser@localhost;
flush privileges;
select TABLE_SCHEMA, upper(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
TABLE_SCHEMA upper(TABLE_NAME) TABLE_CATALOG
performance_schema COND_INSTANCES def
performance_schema EVENTS_WAITS_CURRENT def
performance_schema EVENTS_WAITS_HISTORY def
performance_schema EVENTS_WAITS_HISTORY_LONG def
performance_schema EVENTS_WAITS_SUMMARY_BY_EVENT_NAME def
performance_schema EVENTS_WAITS_SUMMARY_BY_INSTANCE def
performance_schema EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME def
performance_schema FILE_INSTANCES def
performance_schema FILE_SUMMARY_BY_EVENT_NAME def
performance_schema FILE_SUMMARY_BY_INSTANCE def
performance_schema MUTEX_INSTANCES def
performance_schema PERFORMANCE_TIMERS def
performance_schema PROCESSLIST def
performance_schema RWLOCK_INSTANCES def
performance_schema SETUP_CONSUMERS def
performance_schema SETUP_INSTRUMENTS def
performance_schema SETUP_OBJECTS def
performance_schema SETUP_TIMERS def
select upper(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) TABLE_TYPE ENGINE
COND_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
EVENTS_WAITS_CURRENT BASE TABLE PERFORMANCE_SCHEMA
EVENTS_WAITS_HISTORY BASE TABLE PERFORMANCE_SCHEMA
EVENTS_WAITS_HISTORY_LONG BASE TABLE PERFORMANCE_SCHEMA
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
EVENTS_WAITS_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
FILE_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
FILE_SUMMARY_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
FILE_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA
MUTEX_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
PERFORMANCE_TIMERS BASE TABLE PERFORMANCE_SCHEMA
PROCESSLIST BASE TABLE PERFORMANCE_SCHEMA
RWLOCK_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
SETUP_CONSUMERS BASE TABLE PERFORMANCE_SCHEMA
SETUP_INSTRUMENTS BASE TABLE PERFORMANCE_SCHEMA
SETUP_OBJECTS BASE TABLE PERFORMANCE_SCHEMA
SETUP_TIMERS BASE TABLE PERFORMANCE_SCHEMA
select upper(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) VERSION ROW_FORMAT
COND_INSTANCES 10 Dynamic
EVENTS_WAITS_CURRENT 10 Dynamic
EVENTS_WAITS_HISTORY 10 Dynamic
EVENTS_WAITS_HISTORY_LONG 10 Dynamic
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 10 Dynamic
EVENTS_WAITS_SUMMARY_BY_INSTANCE 10 Dynamic
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 10 Dynamic
FILE_INSTANCES 10 Dynamic
FILE_SUMMARY_BY_EVENT_NAME 10 Dynamic
FILE_SUMMARY_BY_INSTANCE 10 Dynamic
MUTEX_INSTANCES 10 Dynamic
PERFORMANCE_TIMERS 10 Fixed
PROCESSLIST 10 Dynamic
RWLOCK_INSTANCES 10 Dynamic
SETUP_CONSUMERS 10 Dynamic
SETUP_INSTRUMENTS 10 Dynamic
SETUP_OBJECTS 10 Dynamic
SETUP_TIMERS 10 Dynamic
select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH
COND_INSTANCES 1000 0
EVENTS_WAITS_CURRENT 1000 0
EVENTS_WAITS_HISTORY 1000 0
EVENTS_WAITS_HISTORY_LONG 10000 0
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 1000 0
EVENTS_WAITS_SUMMARY_BY_INSTANCE 1000 0
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 1000 0
FILE_INSTANCES 1000 0
FILE_SUMMARY_BY_EVENT_NAME 1000 0
FILE_SUMMARY_BY_INSTANCE 1000 0
MUTEX_INSTANCES 1000 0
PERFORMANCE_TIMERS 5 0
PROCESSLIST 1000 0
RWLOCK_INSTANCES 1000 0
SETUP_CONSUMERS 8 0
SETUP_INSTRUMENTS 1000 0
SETUP_OBJECTS 1000 0
SETUP_TIMERS 1 0
select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH
COND_INSTANCES 0 0
EVENTS_WAITS_CURRENT 0 0
EVENTS_WAITS_HISTORY 0 0
EVENTS_WAITS_HISTORY_LONG 0 0
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 0 0
EVENTS_WAITS_SUMMARY_BY_INSTANCE 0 0
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 0 0
FILE_INSTANCES 0 0
FILE_SUMMARY_BY_EVENT_NAME 0 0
FILE_SUMMARY_BY_INSTANCE 0 0
MUTEX_INSTANCES 0 0
PERFORMANCE_TIMERS 0 0
PROCESSLIST 0 0
RWLOCK_INSTANCES 0 0
SETUP_CONSUMERS 0 0
SETUP_INSTRUMENTS 0 0
SETUP_OBJECTS 0 0
SETUP_TIMERS 0 0
select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT
COND_INSTANCES 0 0 NULL
EVENTS_WAITS_CURRENT 0 0 NULL
EVENTS_WAITS_HISTORY 0 0 NULL
EVENTS_WAITS_HISTORY_LONG 0 0 NULL
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 0 0 NULL
EVENTS_WAITS_SUMMARY_BY_INSTANCE 0 0 NULL
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 0 0 NULL
FILE_INSTANCES 0 0 NULL
FILE_SUMMARY_BY_EVENT_NAME 0 0 NULL
FILE_SUMMARY_BY_INSTANCE 0 0 NULL
MUTEX_INSTANCES 0 0 NULL
PERFORMANCE_TIMERS 0 0 NULL
PROCESSLIST 0 0 NULL
RWLOCK_INSTANCES 0 0 NULL
SETUP_CONSUMERS 0 0 NULL
SETUP_INSTRUMENTS 0 0 NULL
SETUP_OBJECTS 0 0 NULL
SETUP_TIMERS 0 0 NULL
select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME
COND_INSTANCES NULL NULL NULL
EVENTS_WAITS_CURRENT NULL NULL NULL
EVENTS_WAITS_HISTORY NULL NULL NULL
EVENTS_WAITS_HISTORY_LONG NULL NULL NULL
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME NULL NULL NULL
EVENTS_WAITS_SUMMARY_BY_INSTANCE NULL NULL NULL
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME NULL NULL NULL
FILE_INSTANCES NULL NULL NULL
FILE_SUMMARY_BY_EVENT_NAME NULL NULL NULL
FILE_SUMMARY_BY_INSTANCE NULL NULL NULL
MUTEX_INSTANCES NULL NULL NULL
PERFORMANCE_TIMERS NULL NULL NULL
PROCESSLIST NULL NULL NULL
RWLOCK_INSTANCES NULL NULL NULL
SETUP_CONSUMERS NULL NULL NULL
SETUP_INSTRUMENTS NULL NULL NULL
SETUP_OBJECTS NULL NULL NULL
SETUP_TIMERS NULL NULL NULL
select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) TABLE_COLLATION CHECKSUM
COND_INSTANCES utf8_general_ci NULL
EVENTS_WAITS_CURRENT utf8_general_ci NULL
EVENTS_WAITS_HISTORY utf8_general_ci NULL
EVENTS_WAITS_HISTORY_LONG utf8_general_ci NULL
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME utf8_general_ci NULL
EVENTS_WAITS_SUMMARY_BY_INSTANCE utf8_general_ci NULL
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME utf8_general_ci NULL
FILE_INSTANCES utf8_general_ci NULL
FILE_SUMMARY_BY_EVENT_NAME utf8_general_ci NULL
FILE_SUMMARY_BY_INSTANCE utf8_general_ci NULL
MUTEX_INSTANCES utf8_general_ci NULL
PERFORMANCE_TIMERS utf8_general_ci NULL
PROCESSLIST utf8_general_ci NULL
RWLOCK_INSTANCES utf8_general_ci NULL
SETUP_CONSUMERS utf8_general_ci NULL
SETUP_INSTRUMENTS utf8_general_ci NULL
SETUP_OBJECTS utf8_general_ci NULL
SETUP_TIMERS utf8_general_ci NULL
select upper(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
upper(TABLE_NAME) TABLE_COMMENT
COND_INSTANCES
EVENTS_WAITS_CURRENT
EVENTS_WAITS_HISTORY
EVENTS_WAITS_HISTORY_LONG
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
EVENTS_WAITS_SUMMARY_BY_INSTANCE
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
FILE_INSTANCES
FILE_SUMMARY_BY_EVENT_NAME
FILE_SUMMARY_BY_INSTANCE
MUTEX_INSTANCES
PERFORMANCE_TIMERS
PROCESSLIST
RWLOCK_INSTANCES
SETUP_CONSUMERS
SETUP_INSTRUMENTS
SETUP_OBJECTS
SETUP_TIMERS
SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
WHERE THREAD_ID IN
(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
AND EVENT_NAME IN
(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
create table test.t1(a int) engine=performance_schema;
ERROR HY000: Invalid performance_schema usage.
create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
ERROR HY000: Invalid performance_schema usage.
create table performance_schema.t1(a int);
ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1'
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/io/file/myisam/%";
update performance_schema.SETUP_CONSUMERS
set enabled='YES';
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
drop table if exists test.no_index_tab;
create table test.no_index_tab ( a varchar(255), b int ) engine=myisam;
insert into no_index_tab set a = 'foo', b = 1;
insert into no_index_tab set a = 'foo', b = 1;
insert into no_index_tab set a = 'foo', b = 1;
select event_name,
left(source, locate(":", source)) as short_source,
operation, number_of_bytes,
substring(object_name, locate("no_index_tab", object_name)) as short_name
from performance_schema.EVENTS_WAITS_HISTORY_LONG
where operation not like "tell"
order by thread_id, event_id;
event_name short_source operation number_of_bytes short_name
wait/io/file/myisam/kfile mi_create.c: create NULL no_index_tab.MYI
wait/io/file/myisam/dfile mi_create.c: create NULL no_index_tab.MYD
wait/io/file/myisam/kfile mi_open.c: write 176 no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: write 100 no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: write 7 no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: write 7 no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: write 7 no_index_tab.MYI
wait/io/file/myisam/kfile mi_create.c: chsize 1024 no_index_tab.MYI
wait/io/file/myisam/dfile mi_create.c: close NULL no_index_tab.MYD
wait/io/file/myisam/kfile mi_create.c: close NULL no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: open NULL no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: read 24 no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: seek NULL no_index_tab.MYI
wait/io/file/myisam/kfile mi_open.c: read 297 no_index_tab.MYI
wait/io/file/myisam/dfile mi_open.c: open NULL no_index_tab.MYD
wait/io/file/myisam/kfile mi_locking.c: write 3 no_index_tab.MYI
wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD
wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI
wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD
wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI
wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD
wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI
show status like 'performance_schema_%';
Variable_name Value
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
drop table test.no_index_tab;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_CONSUMERS set enabled='YES';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
drop table if exists test.t1;
truncate table performance_schema.EVENTS_WAITS_CURRENT;
truncate table performance_schema.EVENTS_WAITS_HISTORY;
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
show variables like "thread_handling";
Variable_name Value
thread_handling no-threads
create table test.t1(a int) engine=MYISAM;
show variables like "performance_schema";
Variable_name Value
performance_schema ON
show variables like "performance_schema_max_thread%";
Variable_name Value
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 10
select count(*) from performance_schema.PROCESSLIST
where name like "thread/sql/main";
count(*)
1
select count(*) from performance_schema.PROCESSLIST
where name like "thread/sql/OneConnection";
count(*)
0
select event_name, operation,
left(source, locate(":", source)) as short_source
from performance_schema.EVENTS_WAITS_CURRENT;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
select event_name, operation,
left(source, locate(":", source)) as short_source
from performance_schema.EVENTS_WAITS_HISTORY;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
select event_name, operation,
left(source, locate(":", source)) as short_source
from performance_schema.EVENTS_WAITS_HISTORY_LONG;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
drop table test.t1;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
drop table if exists test.t1;
drop table if exists test.t2;
drop table if exists test.t3;
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
show variables like "thread_handling";
Variable_name Value
thread_handling one-thread-per-connection
"----------------- Connection 1"
create table test.t1(a int) engine=MYISAM;
"----------------- Connection 2"
create table test.t2(a int) engine=MYISAM;
"----------------- Connection 3"
create table test.t3(a int) engine=MYISAM;
"----------------- Connection default"
execute stmt_dump_events using @tid;
event_name short_source operation number_of_bytes
wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL
execute stmt_dump_thread using @tid;
name
thread/sql/one_connection
execute stmt_dump_events using @tid;
event_name short_source operation number_of_bytes
wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL
execute stmt_dump_thread using @tid;
name
thread/sql/one_connection
execute stmt_dump_events using @tid;
event_name short_source operation number_of_bytes
wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL
execute stmt_dump_thread using @tid;
name
thread/sql/one_connection
drop table test.t1;
drop table test.t2;
drop table test.t3;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
This diff is collapsed.
drop table if exists t1;
create table t1 (a int not null);
insert into t1 values (1), (2), (3);
SET GLOBAL query_cache_size=1355776;
flush query cache;
reset query cache;
select * from t1;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
select * from t1;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
spins
NULL
select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
name
wait/io/file/csv/data
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
spins
NULL
select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
name
wait/io/file/csv/data
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
SET GLOBAL query_cache_size= default;
drop table t1;
use performance_schema;
set @start_read_only= @@global.read_only;
grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost;
flush privileges;
connect (con1, localhost, pfsuser, , test);
connection default;
set global read_only=0;
connection con1;
select @@global.read_only;
@@global.read_only
0
show grants;
Grants for pfsuser@localhost
GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
select * from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
connection default;
set global read_only=1;
connection con1;
select @@global.read_only;
@@global.read_only
1
show grants;
Grants for pfsuser@localhost
GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
select * from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
connection default;
grant super on *.* to pfsuser@localhost;
flush privileges;
connect (con1, localhost, pfsuser, , test);
select @@global.read_only;
@@global.read_only
1
show grants;
Grants for pfsuser@localhost
GRANT SUPER ON *.* TO 'pfsuser'@'localhost'
GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
select * from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
connection default;
set global read_only= @start_read_only;
drop user pfsuser@localhost;
flush privileges;
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
use performance_schema;
show tables;
Tables_in_performance_schema
COND_INSTANCES
EVENTS_WAITS_CURRENT
EVENTS_WAITS_HISTORY
EVENTS_WAITS_HISTORY_LONG
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
EVENTS_WAITS_SUMMARY_BY_INSTANCE
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
FILE_INSTANCES
FILE_SUMMARY_BY_EVENT_NAME
FILE_SUMMARY_BY_INSTANCE
MUTEX_INSTANCES
PERFORMANCE_TIMERS
PROCESSLIST
RWLOCK_INSTANCES
SETUP_CONSUMERS
SETUP_INSTRUMENTS
SETUP_OBJECTS
SETUP_TIMERS
show create table COND_INSTANCES;
Table Create Table
COND_INSTANCES CREATE TABLE `COND_INSTANCES` (
`NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table EVENTS_WAITS_CURRENT;
Table Create Table
EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`SOURCE` varchar(64) DEFAULT NULL,
`TIMER_START` bigint(20) unsigned DEFAULT NULL,
`TIMER_END` bigint(20) unsigned DEFAULT NULL,
`TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
`SPINS` int(10) unsigned DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(512) DEFAULT NULL,
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
`OPERATION` varchar(16) NOT NULL,
`NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table EVENTS_WAITS_HISTORY;
Table Create Table
EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`SOURCE` varchar(64) DEFAULT NULL,
`TIMER_START` bigint(20) unsigned DEFAULT NULL,
`TIMER_END` bigint(20) unsigned DEFAULT NULL,
`TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
`SPINS` int(10) unsigned DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(512) DEFAULT NULL,
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
`OPERATION` varchar(16) NOT NULL,
`NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table EVENTS_WAITS_HISTORY_LONG;
Table Create Table
EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`SOURCE` varchar(64) DEFAULT NULL,
`TIMER_START` bigint(20) unsigned DEFAULT NULL,
`TIMER_END` bigint(20) unsigned DEFAULT NULL,
`TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
`SPINS` int(10) unsigned DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(512) DEFAULT NULL,
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
`OPERATION` varchar(16) NOT NULL,
`NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
Table Create Table
EVENTS_WAITS_SUMMARY_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_EVENT_NAME` (
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
`SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE;
Table Create Table
EVENTS_WAITS_SUMMARY_BY_INSTANCE CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_INSTANCE` (
`EVENT_NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
`SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
Table Create Table
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
`SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table FILE_INSTANCES;
Table Create Table
FILE_INSTANCES CREATE TABLE `FILE_INSTANCES` (
`FILE_NAME` varchar(512) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`OPEN_COUNT` int(10) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table FILE_SUMMARY_BY_EVENT_NAME;
Table Create Table
FILE_SUMMARY_BY_EVENT_NAME CREATE TABLE `FILE_SUMMARY_BY_EVENT_NAME` (
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_READ` bigint(20) unsigned NOT NULL,
`COUNT_WRITE` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table FILE_SUMMARY_BY_INSTANCE;
Table Create Table
FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` (
`FILE_NAME` varchar(512) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_READ` bigint(20) unsigned NOT NULL,
`COUNT_WRITE` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table MUTEX_INSTANCES;
Table Create Table
MUTEX_INSTANCES CREATE TABLE `MUTEX_INSTANCES` (
`NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table PERFORMANCE_TIMERS;
Table Create Table
PERFORMANCE_TIMERS CREATE TABLE `PERFORMANCE_TIMERS` (
`TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL,
`TIMER_FREQUENCY` bigint(20) DEFAULT NULL,
`TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
`TIMER_OVERHEAD` bigint(20) DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table PROCESSLIST;
Table Create Table
PROCESSLIST CREATE TABLE `PROCESSLIST` (
`THREAD_ID` int(11) NOT NULL,
`ID` int(11) NOT NULL,
`NAME` varchar(64) NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table RWLOCK_INSTANCES;
Table Create Table
RWLOCK_INSTANCES CREATE TABLE `RWLOCK_INSTANCES` (
`NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL,
`READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table SETUP_CONSUMERS;
Table Create Table
SETUP_CONSUMERS CREATE TABLE `SETUP_CONSUMERS` (
`NAME` varchar(64) NOT NULL,
`ENABLED` enum('YES','NO') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table SETUP_INSTRUMENTS;
Table Create Table
SETUP_INSTRUMENTS CREATE TABLE `SETUP_INSTRUMENTS` (
`NAME` varchar(128) NOT NULL,
`ENABLED` enum('YES','NO') NOT NULL,
`TIMED` enum('YES','NO') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table SETUP_OBJECTS;
Table Create Table
SETUP_OBJECTS CREATE TABLE `SETUP_OBJECTS` (
`OBJECT_TYPE` varchar(64) DEFAULT NULL,
`OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
`OBJECT_NAME` varchar(64) DEFAULT NULL,
`ENABLED` enum('YES','NO') NOT NULL,
`TIMED` enum('YES','NO') NOT NULL,
`AGGREGATED` enum('YES','NO') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table SETUP_TIMERS;
Table Create Table
SETUP_TIMERS CREATE TABLE `SETUP_TIMERS` (
`NAME` varchar(64) NOT NULL,
`TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
SELECT OPERATION, SUM(NUMBER_OF_BYTES) AS TOTAL
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
GROUP BY OPERATION
HAVING TOTAL IS NOT NULL
ORDER BY OPERATION
LIMIT 1;
OPERATION TOTAL
chsize [NUM_BYTES]
SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
WHERE THREAD_ID IN
(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
AND EVENT_NAME IN
(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
EVENT_ID
[EVENT_ID]
SELECT DISTINCT EVENT_ID
FROM performance_schema.EVENTS_WAITS_CURRENT
JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
JOIN performance_schema.EVENTS_WAITS_HISTORY_LONG USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
EVENT_ID
[EVENT_ID]
SELECT t1.THREAD_ID, t2.EVENT_ID, t3.EVENT_NAME, t4.TIMER_WAIT
FROM performance_schema.EVENTS_WAITS_HISTORY t1
JOIN performance_schema.EVENTS_WAITS_HISTORY t2 USING (EVENT_ID)
JOIN performance_schema.EVENTS_WAITS_HISTORY t3 ON (t2.THREAD_ID = t3.THREAD_ID)
JOIN performance_schema.EVENTS_WAITS_HISTORY t4 ON (t3.EVENT_NAME = t4.EVENT_NAME)
ORDER BY t1.EVENT_ID, t2.EVENT_ID
LIMIT 5;
THREAD_ID EVENT_ID EVENT_NAME TIMER_WAIT
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
SELECT THREAD_ID, EVENT_ID FROM (
SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
UNION
SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY
UNION
SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
) t1 ORDER BY THREAD_ID, EVENT_ID
LIMIT 5;
THREAD_ID EVENT_ID
[THREAD_ID] [EVENT_ID]
[THREAD_ID] [EVENT_ID]
[THREAD_ID] [EVENT_ID]
[THREAD_ID] [EVENT_ID]
[THREAD_ID] [EVENT_ID]
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
DO SELECT DISTINCT EVENT_ID
FROM performance_schema.EVENTS_WAITS_CURRENT
JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
ALTER TABLE t1 ADD COLUMN c INT;
CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
FOR EACH ROW BEGIN
SET NEW.c = (SELECT MAX(EVENT_ID)
FROM performance_schema.EVENTS_WAITS_CURRENT);
END;
|
INSERT INTO t1 (id) VALUES (11), (12), (13);
SELECT id, c FROM t1 WHERE id > 10 ORDER BY c;
id c
11 [EVENT_ID]
12 [EVENT_ID]
13 [EVENT_ID]
DROP TRIGGER t_ps_trigger;
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
BEGIN
SELECT id FROM performance_schema.PROCESSLIST
WHERE THREAD_ID = tid INTO pid;
END;
|
CALL t_ps_proc(0, @p_id);
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
BEGIN
return (SELECT id FROM performance_schema.PROCESSLIST
WHERE THREAD_ID = tid);
END;
|
SELECT t_ps_func(0) = @p_id;
t_ps_func(0) = @p_id
1
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
DROP TABLE t1;
use performance_schema;
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_threads";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_malloc";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_open";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_isam";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_heap";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_net";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_charset";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_time";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/mysys/THR_COND_threads";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_mysql_create_db";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_open";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_lock_db";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_thread_count";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_mapped_file";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_status";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_error_log";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_delayed_insert";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_uuid_generator";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_delayed_status";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_delayed_create";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_crypt";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_slave_list";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_active_mi";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_manager";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_global_read_lock";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_global_system_variables";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_user_conn";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_connection_count";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_server_started";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_rpl_status";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOG_INFO::lock";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_event_metadata";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_event_queue";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_user_locks";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Cversion_lock";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_xid_cache";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_plugin";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_gdl";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/tz_LOCK";
count(name)
1
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_grant";
count(name)
1
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect";
count(name)
1
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_sys_init_slave";
count(name)
1
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_server_started";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_refresh";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_thread_count";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_manager";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_global_read_lock";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_thread_cache";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_flush_thread_cache";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_rpl_status";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Event_scheduler::COND_state";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_queue_state";
count(name)
1
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 0
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
Variable_name Value
performance_schema_max_cond_classes 0
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/cond/%";
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_COND_CLASSES_LOST';
variable_value > 0
1
select count(*) from performance_schema.COND_INSTANCES;
count(*)
0
show status like "performance_schema_cond_instances_lost";
Variable_name Value
Performance_schema_cond_instances_lost 0
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 0
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
Variable_name Value
performance_schema_max_cond_classes 80
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/cond/%";
count(*) > 0
1
show status like "performance_schema_cond_classes_lost";
Variable_name Value
Performance_schema_cond_classes_lost 0
show variables like "performance_schema_max_cond_instances";
Variable_name Value
performance_schema_max_cond_instances 0
select count(*) from performance_schema.COND_INSTANCES;
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_COND_INSTANCES_LOST';
variable_value > 0
1
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 0
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
Variable_name Value
performance_schema_max_file_classes 0
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/io/file/%";
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_FILE_CLASSES_LOST';
variable_value > 0
1
select count(*) from performance_schema.FILE_INSTANCES;
count(*)
0
show status like "performance_schema_file_instances_lost";
Variable_name Value
Performance_schema_file_instances_lost 0
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 0
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
Variable_name Value
performance_schema_max_file_classes 50
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/io/file/%";
count(*) > 0
1
show status like "performance_schema_file_classes_lost";
Variable_name Value
Performance_schema_file_classes_lost 0
show variables like "performance_schema_max_file_instances";
Variable_name Value
performance_schema_max_file_instances 0
select count(*) from performance_schema.FILE_INSTANCES;
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_FILE_INSTANCES_LOST';
variable_value > 0
1
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 0
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
Variable_name Value
performance_schema_max_mutex_classes 0
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/mutex/%";
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_CLASSES_LOST';
variable_value > 0
1
select count(*) from performance_schema.MUTEX_INSTANCES;
count(*)
0
show status like "performance_schema_mutex_instances_lost";
Variable_name Value
Performance_schema_mutex_instances_lost 0
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 0
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
Variable_name Value
performance_schema_max_mutex_classes 200
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/mutex/%";
count(*) > 0
1
show status like "performance_schema_mutex_classes_lost";
Variable_name Value
Performance_schema_mutex_classes_lost 0
show variables like "performance_schema_max_mutex_instances";
Variable_name Value
performance_schema_max_mutex_instances 0
select count(*) from performance_schema.MUTEX_INSTANCES;
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_INSTANCES_LOST';
variable_value > 0
1
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 0
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
Variable_name Value
performance_schema_max_rwlock_classes 0
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_CLASSES_LOST';
variable_value > 0
1
select count(*) from performance_schema.RWLOCK_INSTANCES;
count(*)
0
show status like "performance_schema_rwlock_instances_lost";
Variable_name Value
Performance_schema_rwlock_instances_lost 0
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 0
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
Variable_name Value
performance_schema_max_rwlock_classes 20
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
count(*) > 0
1
show status like "performance_schema_rwlock_classes_lost";
Variable_name Value
Performance_schema_rwlock_classes_lost 0
show variables like "performance_schema_max_rwlock_instances";
Variable_name Value
performance_schema_max_rwlock_instances 0
select count(*) from performance_schema.RWLOCK_INSTANCES;
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_INSTANCES_LOST';
variable_value > 0
1
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 0
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
Variable_name Value
performance_schema_max_thread_classes 0
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "thread/%";
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST';
variable_value > 0
1
select count(*) from performance_schema.PROCESSLIST;
count(*)
0
show status like "performance_schema_thread_instances_lost";
Variable_name Value
Performance_schema_thread_instances_lost 0
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 0
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
Variable_name Value
performance_schema_max_thread_classes 50
show status like "performance_schema_thread_classes_lost";
Variable_name Value
Performance_schema_thread_classes_lost 0
show variables like "performance_schema_max_thread_instances";
Variable_name Value
performance_schema_max_thread_instances 0
select count(*) from performance_schema.PROCESSLIST;
count(*)
0
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_THREAD_INSTANCES_LOST';
variable_value > 0
1
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
0
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema OFF
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show status like "performance_schema%";
Variable_name Value
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
show databases;
Database
information_schema
mtr
mysql
performance_schema
test
select count(*) from performance_schema.PERFORMANCE_TIMERS;
count(*)
5
select count(*) from performance_schema.SETUP_CONSUMERS;
count(*)
8
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
count(*) > 0
1
select count(*) from performance_schema.SETUP_TIMERS;
count(*)
1
select * from performance_schema.COND_INSTANCES;
select * from performance_schema.EVENTS_WAITS_CURRENT;
select * from performance_schema.EVENTS_WAITS_HISTORY;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
select * from performance_schema.FILE_INSTANCES;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.PROCESSLIST;
select * from performance_schema.RWLOCK_INSTANCES;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
select * from performance_schema.SETUP_TIMERS;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000
performance_schema_max_rwlock_classes 20
performance_schema_max_rwlock_instances 1000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show status like "performance_schema%";
Variable_name Value
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
call mtr.add_suppression(
"Column count of mysql.SETUP_INSTRUMENTS is wrong. "
"Expected 4, found 3. The table is probably corrupted");
select * from performance_schema.SETUP_INSTRUMENTS limit 1;
ERROR HY000: Native table 'performance_schema'.'SETUP_INSTRUMENTS' has the wrong structure
select * from performance_schema.SETUP_CONSUMERS limit 1;
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
# Verify that statistics aggregated by different criteria are consistent.
--source include/not_embedded.inc
--source include/have_perfschema.inc
--echo "General cleanup"
--disable_warnings
drop table if exists t1;
--enable_warnings
update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO';
update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
# Cleanup statistics
truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
# Start recording data
update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
update performance_schema.SETUP_INSTRUMENTS
set enabled = 'YES', timed = 'YES';
create table t1 (
id INT PRIMARY KEY,
b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
# Stop recording data, so the select below don't add noise.
update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO';
# Helper to debug
set @dump_all=FALSE;
# Note that in general:
# - COUNT/SUM/MAX(FILE_SUMMARY_BY_EVENT_NAME) >=
# COUNT/SUM/MAX(FILE_SUMMARY_BY_INSTANCE).
# - MIN(FILE_SUMMARY_BY_EVENT_NAME) <=
# MIN(FILE_SUMMARY_BY_INSTANCE).
# There will be equality only when file instances are not removed,
# aka when a file is not deleted from the file system,
# because doing so removes a row in FILE_SUMMARY_BY_INSTANCE.
# Likewise:
# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) >=
# COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_INSTANCE)
# - MIN(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) <=
# MIN(EVENTS_WAITS_SUMMARY_BY_INSTANCE)
# There will be equality only when an instrument instance
# is not removed, which is next to impossible to predictably guarantee
# in the server.
# For example, a MyISAM table removed from the table cache
# will cause a mysql_mutex_destroy on myisam/MYISAM_SHARE::intern_lock.
# Another example, a thread terminating will cause a mysql_mutex_destroy
# on sql/LOCK_delete
# Both cause a row to be deleted from EVENTS_WAITS_SUMMARY_BY_INSTANCE.
# Likewise:
# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) >=
# COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME)
# - MIN(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) <=
# MIN(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME)
# There will be equality only when no thread is removed,
# that is if no thread disconnects, or no sub thread (for example insert
# delayed) ever completes.
# A thread completing will cause rows in
# EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME to be removed.
--echo "Verifying file aggregate consistency"
# Since the code generating the load in this test does:
# - create table
# - insert
# - does not cause temporary tables to be used
# we can test for equality here for file aggregates.
# If any of these queries returns data, the test failed.
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
OR @dump_all;
--echo "Verifying waits aggregate consistency (instance)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT <> SUM(i.SUM_TIMER_WAIT))
OR @dump_all;
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT <> MIN(i.MIN_TIMER_WAIT))
AND (MIN(i.MIN_TIMER_WAIT) != 0)
OR @dump_all;
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT <> MAX(i.MAX_TIMER_WAIT))
OR @dump_all;
--echo "Verifying waits aggregate consistency (thread)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT))
OR @dump_all;
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT))
AND (MIN(t.MIN_TIMER_WAIT) != 0)
OR @dump_all;
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT))
OR @dump_all;
# Cleanup
update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
update performance_schema.SETUP_INSTRUMENTS
set enabled = 'YES', timed = 'YES';
drop table test.t1;
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
# Check error handling for invalid server start options
--source include/not_embedded.inc
--source include/have_perfschema.inc
--error 7
--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $MYSQLTEST_VARDIR/tmp/bad_option_1.txt 2>&1
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_1.txt";
open(FILE, "<", $fname) or die;
my @lines= <FILE>;
# those must be in the file for the test to pass
my @patterns=
("unknown variable 'performance-schema-enabled=maybe'",
"Aborting");
foreach my $one_line (@lines)
{
foreach my $one_pattern (@patterns)
{
# print pattern, not line, to get a stable output
print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
}
}
close FILE;
EOF
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
# Check error handling for ambiguous server start options
--source include/not_embedded.inc
--source include/have_perfschema.inc
--error 3
--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $MYSQLTEST_VARDIR/tmp/bad_option_2.txt 2>&1
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_2.txt";
open(FILE, "<", $fname) or die;
my @lines= <FILE>;
# those must be in the file for the test to pass
my @patterns=
("ambiguous option '--performance-schema-max_=12'");
foreach my $one_line (@lines)
{
foreach my $one_pattern (@patterns)
{
# print pattern, not line, to get a stable output
print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
}
}
close FILE;
EOF
# Copyright (C) 2009 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for PERFORMANCE_SCHEMA
--source include/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
# See Bug#46896 binlog: case sensitivity of table names
--source include/have_lowercase0.inc
set binlog_format=mixed;
--source ../include/binlog_common.inc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment