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
Why is my mysql slow_query_log empty?
I have the following setup on a production machine:
Mysql server 5.5.19
the active (checked the ps line) my.cnf contains:
slow_query_log
slow_query_log_file =/opt/app/mysql/log/mysqld-slow.log
long_query_time = 1
general_log =…

Ethan Arnold
- 134
- 1
- 10
1
vote
2 answers
Long running query issues
I'm trying to fix some issues with a script I didn't make where the site seems to be filling up the mysql /tmp dir very fast.
I checked the slow query log and it has a lot of queries like this..
SELECT
COUNT(*) AS `total`
FROM
(
…

Brett
- 19,449
- 54
- 157
- 290
1
vote
1 answer
mysql slow query sql statement is not as slow when executed from mysql prompt
I have enabled mysql slow query in my server to log queries that takes over 5 seconds. When I run the same query from the mysql>, the queries that reported over 10 seconds took less than 1 second. Why is that?
TIA,
-peter

cfpete
- 4,143
- 8
- 27
- 23
0
votes
2 answers
Django slow queries: Connect django filter statements to slow queries in database logs
If you are trying to diagnose slow queries in your mysql backend and are using a Django frontend, how do you tie together the slow queries reported by the backend with specific querysets in the Django frontend code?

MikeN
- 45,039
- 49
- 151
- 227
0
votes
2 answers
Mysql Lock times in slow query log
I have an application that has been running fine for quite awhile, but recently a couple of items have started popping up in the slow query log.
All the queries are complex and ugly multi join select statements that could use refactoring. I believe…

cgr
- 1,093
- 1
- 8
- 14
0
votes
1 answer
How to check Slow Query for MySQL in GCP
Building a MySQL DataBase with GCP's CloudSQL.
To check Slow Query in MySQL, we have enabled the following labels
[Label]
slow_query_log: on
log_output: file
long_query_time: 3
After configuring the above settings, I checked the mysql-slow.log of…

Tetsuya Saitou
- 1
- 2
0
votes
3 answers
How to improve slow query performance?
I have a multi-join query that targeting the hospital's chart database.
this takes 5~10 seconds or more.
This is the visual expain using mysql workbench.
The query is below.
select sc.CLIENT_ID as 'guardianId', sp.PET_ID as 'patientId', sp.NAME as…

Cho
- 163
- 3
- 13
0
votes
1 answer
Slow query log - Row_send record count differs with actual records
Recently in my application which uses MariaDB 10.6, I am facing some weird issues where the same query took more than the expected time and consumes more IO at random times.
Enabled slow query to trace the same where we see a query stuck more than…

ragul rangarajan
- 167
- 2
- 12
0
votes
0 answers
Why in codeignitor 3 mysqli update query taking more then 20 seconds
while debugging when I reach on this point it took some time more then minute.
$this->db->where('userid', $userid);
$this->db->update('tbluser', ['activity' => date('Y-m-d H:i:s')]);
I have executed same update query string in phpmyadmin…

Mohammad Junaid
- 1
- 2
0
votes
0 answers
WordPress / WooCommerce update statement blocks entire MariaDB database on WP Multisite setup
I have a wordpress/woocommerce stack with a couple of plugins activated, once or twice a day MariaDB database (AWS RDS MariaDB 10.6) hangs and becomes completely unreachable to the point where I need to reboot the instance.
The error log shows too…

J88
- 811
- 7
- 20
0
votes
1 answer
Slow Log Issue: SP Calls Not Highlighting Against Temporary Table
I have activated slow logs in mysql 5.7.30. I notice some SP's calls are not highlighting in slow logs even its taking more then time to my threshold value which is 2-sec. On investigation, I found the calls which are using temporary tables are not…

Irfi
- 49
- 2
- 6
0
votes
1 answer
Slow Query - Changing it producing odd results
I have a query I am trying to optimize but the results aren't making sense to me.
It takes roughly 7 seconds to complete this:
SELECT users.*,states.name AS state_name, CONCAT_WS(" - ",L1.updated_at,L1.last_location) AS last_activity,
(SELECT…

Danny
- 1,185
- 2
- 12
- 33
0
votes
2 answers
MYSQL 8.0.26 using CPU upto 300-400%
See my processes screenshots
I have ubuntu server 20.0 having following VPS configuration
4 vCPU Cores
8 GB RAM
50 GB NVMe
I am also attaching my mysqld.cnf
#
# The MySQL database server configuration file.
#
# One can use all long options that the…

Chirag Lukhi
- 1,528
- 17
- 41
0
votes
1 answer
Mysql query return too slow
I have written a query. It works better. But currently, all tables have 100K rows, and one of my queries returns too slow. Can you please suggest to me how I can optimize the query?
select *
from tbl_xray_information X
WHERE locationCode = (SELECT…

Mohammad Shahnewaz Sarker
- 534
- 5
- 17
0
votes
0 answers
Getting slow query. What column should I index and what type of index?
I'm new to MySQL. I'm getting this slow query below.
# Query_time: 3.357236 Lock_time: 0.000054 Rows_sent: 1 Rows_examined: 107494
# Rows_affected: 0 Bytes_sent: 67
SET timestamp=1652612113;
SELECT COUNT(*) FROM et_term_relationships, et_posts…

mewiben39
- 121
- 9