Skip to content

Instantly share code, notes, and snippets.

@realmgic
Created December 11, 2016 20:11
Embed
What would you like to do?
use sys; -- or sys.
--
select * from sys.version;
show full tables in sys;
-- summary views
select * From sys.host_summary\G
-- show view definition -> show x$ definition
select * from `performance_schema`.`events_waits_summary_by_host_by_event_name`;
select * From sys.host_summary
-- which is better?
select * from sys.user_summary_by_file_io_type;
select * from io_by_thread_by_latency;
-- Schema analysis views
-- (only on disk information)
select * from schema_table_statistics where table_schema = 'doag' and table_name = 'employees_old'\G
-- (with memory information)
select * from schema_table_statistics_with_buffer where table_schema = 'doag' and table_name = 'employees_old'\G
-- list of unused indexes
select * From schema_unused_indexes;
-- helper functions
select sys.format_time(82798811507) as time
union select sys.format_time(9710741185261)
union select sys.format_time(116865898735315);
select sys.format_bytes(85857938)
union select sys.format_bytes(8885793826)
union select sys.format_bytes(1911885793826);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment