a log of SQL statements that took more than `long_query_time` seconds to execute that are automatically saved to mysql.slow_query_log table or an output file
Questions tagged [mysql-slow-query-log]
196 questions
1
vote
2 answers
Can I make this mySQL query faster?
I have the following entry in mysql-slow.log:
# Time: 180506 21:57:03
# User@Host: mysqlserver[mysqlserver] @ localhost []
# Query_time: 88.963476 Lock_time: 0.000088 Rows_sent: 50 Rows_examined: 114197
SET timestamp=1525633023;
SELECT…

user164863
- 580
- 1
- 12
- 29
1
vote
0 answers
Amazon RDS - How to get MySQL slow query logs in native format, and not CSV?
A colleague sent me some slow query logs in CSV format from an Amazon RDS instance running MySQL.
Is there a way to convert them into native MySQL slow query log format? Or, even better, obtain directly slow query logs in MySQL native format from…

dr_
- 2,400
- 1
- 25
- 39
1
vote
2 answers
Slow query log logs queries that are fast during testing
My slow query log is full of queries with following query time and rows examined:
# Query_time: 26.370100 Lock_time: 0.000213 Rows_sent: 0 Rows_examined: 30976475
If I copy and paste the exact query from the log into phpmyadmin and run it,…

John Doe
- 983
- 4
- 14
- 27
1
vote
1 answer
Mysql slow query log not honoring long_query_time variable, logs really quick queries
I'm running mysql 5.5 and am debugging a performance issue. I have enabled mysql slow logging. These are my relevant settings in my.cnf:
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 10
log-queries-not-using-indexes
Mysql is…

John Tabs
- 363
- 1
- 3
- 10
1
vote
1 answer
MySQL - Performance Issue in upgrading 5.5.27 to 5.7
I am working on a Query which retrieves the list of service reports along with its details. The query also returns the service report which is missing in the database by putting '--' in the details column. After spending some time on it i have came…

Aswin Arshad
- 90
- 1
- 11
1
vote
1 answer
Mysql, hibernate slow_query_log logs set timestamp
I'm running a load test on java application which uses hibernate framework in DAO layer. I found several occurrences of following in slow query log.
# Time: 170704 15:06:47
# User@Host: user[user] @ localhost [127.0.0.1] Id: 163
# Query_time:…

Yasitha Thilakaratne
- 128
- 1
- 15
1
vote
3 answers
What would be making this query so incredibly slow? (MySQL 5.6.36)
I have an ever-increasing database table of ~8 million rows running, which my application regularly fetches data from. However, the query has suddenly started locking up the entire system. There are tons of mysqld processes clogging up all CPU…

Thierry
- 101
- 1
- 7
1
vote
1 answer
My.cnf file on Mac Sierra for Slow Queries
I am trying to set the time for my slow_query_log but I cannot find the right file:
I got a file under /usr/local/var/mysql
MYUSER-slow.log
which shows me the queries taking 10seconds (standard in MYSQL is 10sec) - I edited the my-default.cnf under…

Isengo
- 2,004
- 3
- 21
- 43
1
vote
0 answers
Lots of slow queries even "SELECT ... WHERE id=..." and "SET TIMESTAMP" in MySQL
I'm using PHP and MySQL/InnoDB.
I have a main News table with around 500K rows.
Three other tables are Source(max 500 rows), Category(12 rows) and Tag(average 2 tags for each record in News) which I frequently use in join with News. Most of my…

mrmowji
- 934
- 8
- 29
1
vote
3 answers
mysql slow query for little data set
Describe:
The table profit has about 20 columns, and no big column like text, and have two indexs:
index idx_uid on column uid
index uid_acc_fId_date on column uid,acc,fid and date
The slow query sql is:
select * from profit where (((uid='1111')…

Stephen Feng
- 71
- 1
- 6
1
vote
2 answers
MariaDB Performance
i'm working with centos 7 and 10.1.8-MariaDB. Some times i'm feeling than the system is slow. Today checking slow querys I've seen update queries really thin or usually fast than take in some stages more than 3 or 4 seconds.
The database is runing…

Oscar Jofre
- 153
- 3
- 17
1
vote
1 answer
Why is MYSQL slow_query_log not enabled?
I have the following in .my.cnf
# LOGGING #
slow_query_log = ON
slow_query_log_file = /var/log/mariadb/slow_query.log
log-queries-not-using-indexes = 1
When I run tuning-primer.sh I get this:
SLOW QUERIES
The slow…

Uhl Hosting
- 57
- 12
1
vote
2 answers
Slow Query issues - get notified
We are facing a critical issue for past two days with slow queries with mysql in our Prod Env (mostly myisam tables older ones)
Right now we are tracking process list,cpu usage etc through nagios.
Is it possible to track a slow query issue occurs…

sikar
- 41
- 5
1
vote
2 answers
Query takes too long to fetch data
I am aware of the slow query log but isnt this just for queries that exceed the maximum execution time? My question is slightly different (i think).
I am running the below query and to me it doesnt seem like it should present a problem. But when i…

MrrMan
- 158
- 1
- 13
1
vote
1 answer
NOT IN subquery takes too long to execute
How do I optimize this query to get the same result, without taking as long? The NOT IN subquery takes a very long time.
SELECT DISTINCT EmployeeId FROM employees
WHERE
status = 'Active'
&& BranchId = '2'
&& NOT EXISTS (
…

nikita priyal
- 13
- 4