简体   繁体   中英

Amazon AWS RDS MySQL slow query log

I have Mysql DB on AWS RDS instance, and I have a slow query log with log_queries_not_using_indexes = YES

And it is working but almost every 5 seconds, this is what I am seeing in log:

SELECT value FROM mysql.rds_heartbeat2;
# Time: 150804 21:00:25
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 1
# Query_time: 0.000154 Lock_time: 0.000058 Rows_sent: 1 Rows_examined: 1
SET timestamp=1438722025;
SELECT NAME, VALUE FROM mysql.rds_configuration;
# Time: 150804 21:00:30
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 1
# Query_time: 0.000233 Lock_time: 0.000113 Rows_sent: 1 Rows_examined: 1
SET timestamp=1438722030;
SELECT count(*) from information_schema.TABLES WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'rds_heartbeat2';
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 1
# Query_time: 0.000116 Lock_time: 0.000039 Rows_sent: 1 Rows_examined: 1
SET timestamp=1438722030;
SELECT value FROM mysql.rds_heartbeat2;
# Time: 150804 21:00:45
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 1
# Query_time: 0.000238 Lock_time: 0.000116 Rows_sent: 1 Rows_examined: 1
SET timestamp=1438722045;
SELECT count(*) from information_schema.TABLES WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'rds_heartbeat2';
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 1
# Query_time: 0.000112 Lock_time: 0.000036 Rows_sent: 1 Rows_examined: 1
SET timestamp=1438722045;
SELECT value FROM mysql.rds_heartbeat2;
# Time: 150804 21:01:00

What is this?

I have maybe one or two my queries which I need to optimize and rest of log file is this.

How is this related to my databases? Those queries are not mine. I believe this is something what AWS do but I don't know why and how it affects the performance.

Those database are part of the Mysql server. Although I suspect that rds_heartbeat2 and rds_configuration are specific to the AWS RDS version of mysql. You can read more about heartbeat .

From dev.mysql :

INFORMATION_SCHEMA is a database within each MySQL instance, the place that stores information about all the other databases that the MySQL server maintains. The INFORMATION_SCHEMA database contains several read-only tables. They are actually views, not base tables, so there are no files associated with them, and you cannot set triggers on them. Also, there is no database directory with that name.

You can run this command to see which databases have MyISAM Tables:

select distinct(table_schema) FROM information_schema.tables where engine = 'MyISAM';

From dev.mysql .

The mysql system database includes several grant tables that contain information about user accounts and the privileges held by them.

You can run this command to see a list of users and host:

select user, host from mysql.user;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM