1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Add more execution stages (commit, rollback, etc)

This was done to get more information about where time is spent.
Now we can get proper timing for time spent in commit, rollback,
binlog write etc.

Following stages was added:
- Commit
- Commit_implicit
- Rollback
- Rollback implicit
- Binlog write
- Init for update
  - This is used instead of "Init" for insert, update and delete.
- Staring cleanup

Following stages where changed:
- "Unlocking tables" stage reset stage to previous stage at end
- "binlog write" stage resets stage to previous stage at end
- "end" -> "end of update loop"
- "cleaning up" -> "Reset for next command"
- Added stage_searching_rows_for_update when searching for rows
  to be deleted.

Other things:
- Renamed all stages to start with big letter (before there was no
  consitency)
- Increased performance_schema_max_stage_classes from 150 to 160.
- Most of the test changes in performance schema comes from renaming of
  stages.
- Removed duplicate output of variables and inital state in a lot of
  performance schema tests.
  This was done to make it easier to change a default value for a
  performance variable without affecting all tests.
- Added start_server_variables.test to check configuration
- Removed some duplicate "closing tables" stages
- Updated position for "stage_init_update" and "stage_updating" for
  delete, insert and update to be just before update loop (for more
  exact timing).
- Don't set "Checking permissions" twice in a row.
- Remove stage_end stage from creating views (not done for create table
  either).
- Updated default performance history size from 10 to 20 because of new
  stages
- Ensure that ps_enabled is correct (to be used in a later patch)
This commit is contained in:
Monty
2017-11-05 17:04:20 +02:00
parent 61706e61fe
commit c9f612dbde
131 changed files with 6016 additions and 9766 deletions

View File

@ -118,10 +118,10 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES'
'idle');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('stage/sql/init',
'stage/sql/checking permissions',
where name in ('stage/sql/Init', 'stage/sql/Init for update',
'stage/sql/Checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables');
'stage/sql/Closing tables');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('statement/sql/select',
@ -247,7 +247,7 @@ prepare dump_stages_account from
"select user, host, event_name, count_star
from performance_schema.events_stages_summary_by_account_by_event_name
where user like \'user%\'
and event_name in ('stage/sql/init',
and event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@ -257,7 +257,7 @@ prepare dump_stages_user from
"select user, event_name, count_star
from performance_schema.events_stages_summary_by_user_by_event_name
where user like \'user%\'
and event_name in ('stage/sql/init',
and event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@ -267,7 +267,7 @@ prepare dump_stages_host from
"select host, event_name, count_star
from performance_schema.events_stages_summary_by_host_by_event_name
where host=\'localhost\'
and event_name in ('stage/sql/init',
and event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@ -276,7 +276,7 @@ prepare dump_stages_host from
prepare dump_stages_global from
"select event_name, count_star
from performance_schema.events_stages_summary_global_by_event_name
where event_name in ('stage/sql/init',
where event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
@ -285,7 +285,7 @@ prepare dump_stages_global from
prepare dump_stages_history from
"select event_name, count(event_name)
from performance_schema.events_stages_history_long
where event_name in ('stage/sql/init',
where event_name in ('stage/sql/init', 'stage/sql/Init for update',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')

View File

@ -13,6 +13,7 @@ select count(*) from performance_schema.setup_timers;
# Make sure we don't crash, no matter what the starting parameters are
--disable_result_log
--disable_query_log
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
@ -66,11 +67,7 @@ select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads;
select * from performance_schema.users;
--enable_result_log
# This has a stable output, printing the result:
show variables where
`Variable_name` != "performance_schema_max_statement_classes" and
`Variable_name` like "performance_schema%";
--enable_query_log
# This has an unrepeatable output, it does depends too much on
# - the platform hardware (sizeof structures, padding)

View File

@ -29,10 +29,12 @@ truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
# Check the configuration is ok
show variables where
`Variable_name` != "performance_schema_max_statement_classes" and
`Variable_name` like "performance_schema%";
show status like "performance_schema%";
# We don't print this as it causes too many changes in test cases if
# one variable changes value
#show variables where
# `Variable_name` != "performance_schema_max_statement_classes" and
# `Variable_name` like "performance_schema%";
#show status like "performance_schema%";
echo "================== Step 1 ==================";
call dump_thread();
@ -493,4 +495,3 @@ execute dump_objects_summary;
# On test failures, may help to track the root cause
show status like "performance_schema%";