forked from FromDual/mariadb-sys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreports.sql
More file actions
19 lines (15 loc) · 685 Bytes
/
reports.sql
File metadata and controls
19 lines (15 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
select 'The following reports are to give a sense of the current state of the database server' as 'Database Server Overview';
select '' as 'Top 5 Largest Tables';
select * from sys.largest_tables Limit 5\G
select '';
select '' as 'Top 5 Worst Queries';
select * from sys.statement_analysis limit 5\G
select '';
select 'The following reports are recommendations on how to improve the database server or where there are inefficiencies' as 'Recommendations';
select * from sys.recommend_compression;
select '';
select * from sys.recommend_drop_indexes;
select '';
select '' as 'Recommended Unoptimised Queries to Fix';
select * from sys.recommend_fix_unoptimised_queries\G
select '';