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
0
votes
1 answer
Getting slow query from SELECT COUNT(*) on WordPress
I have the query below and it gives me a count of 32,000.
SELECT COUNT(*)
FROM wp_term_relationships, wp_posts
WHERE wp_posts.ID = wp_term_relationships.object_id
AND post_status IN ('publish')
AND post_type IN…

mewiben39
- 121
- 9
0
votes
0 answers
How to myke the MySQL Slow Query Log respect the long_query_time?
My Slow Query Log is full of queries, that should not be written there, e.g.:
# Time: 2022-03-11T12:23:29.258308Z
# User@Host: ...
# Schema: ...
# Query_time: 0.022791 Lock_time: 0.000201 Rows_sent: 1000 Rows_examined: 1000 Rows_affected: 0 …

automatix
- 14,018
- 26
- 105
- 230
0
votes
3 answers
Slow count query (mariaDB)
I have a problem with the speed of query. Simple mysql query, but when I have a lot of records (currently > 1 000 000), the performance is really slow. Question is similar to this one, but can't find solution. Explain says that MySQL is using: Using…

wstudiokiwi
- 880
- 1
- 15
- 33
0
votes
2 answers
Slow join with order query
I have a problem with the speed of query. Question is similar to this one, but can't find solution. Explain says that MySQL is using: Using where; Using index; Using temporary; Using filesort
Slow query:
select
distinct(`books`.`id`)
from…

wstudiokiwi
- 880
- 1
- 15
- 33
0
votes
0 answers
MySQL - COUNT(*) very slow
i have one table MySQL InnoDB with 130000 rows and the next query is very slow.
SELECT COUNT(id) FROM mytable;
OR
SELECT COUNT(*) FROM mytable;
Query_time: 12.020727
+--------------+--------------+------+-----+---------+-------+
| Field |…

Moutinho
- 339
- 8
- 22
0
votes
2 answers
Amazon RDS - Slow queries at every minute change
We recently noticed that we have a lot more records in our slow query log at every minute change (at around second 0 of every minute). This didn't seem to be related to any of our cronjobs so I decided to do a quick test on a new RDS t3.micro…

Simon
- 326
- 1
- 12
0
votes
1 answer
MariaDB error and slow query log became empty
So I enabled error log and slow query log on MariaDB and I could see the data in log files. But after a couple of hours when I checked back again then they were empty. It is showing both log files size as 0 and now it is not creating new…

Frank Martin
- 3,147
- 16
- 52
- 73
0
votes
1 answer
How to make mysql-slow.log not telling me that I am not using index?
The table named markets having such columns: id, visible, position, and I created index on visible, every time
and the slow-log always
# Time: 2021-05-12T00:46:14.248654Z
# User@Host: tase[tase] @ ip-172-31-22-13.ap-northeast-1.compute.internal…

Siwei
- 19,858
- 7
- 75
- 95
0
votes
1 answer
mysql: why below query unused union index?
table a
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| uid …

seqwait
- 159
- 1
- 7
0
votes
2 answers
SQL gets slow on a simple query with ORDER BY
I have problem with MySQL ORDER BY, it slows down query and I really don't know why, my query was a little more complex so I simplified it to a light query with no joins, but it stills works really slow.
Query:
SELECT
W.`oid`
FROM
…

Ultrazz008
- 1,678
- 1
- 13
- 26
0
votes
0 answers
SQL Insert New Record if not exists else update the existing one
I have 2 tables Staging & Main Table both has the columns SKU and Price. Records are inserted into staging table from there depending on the record its decided whether new record is to be inserted or update an existing. I have written multiple…

Sandeep Sharma
- 109
- 2
- 15
0
votes
0 answers
Slow Query Log Examination - Inexplicably slow query
I have something that a slow query log has spit out but not sure what it means. I googled around but found nothing and it does not seem like the log itself gave me anything to go on. It sends no rows and examines nothing. Can someone shine some…

mildlylost
- 57
- 6
0
votes
1 answer
Very slow MySQL LeftJoin on AWS RDS, but very quick elsewhere
MySQL in PROD is running through AWS RDS (Aurora, db.t3.small). The resource ultization across the board is well within happy levels.
If I execute the following SELECT, it's almost instanteneous:
SELECT SQL_CALC_FOUND_ROWS `submissions`.*
FROM…

rjbathgate
- 319
- 3
- 14
0
votes
1 answer
Filter AuroraMysql slow query log file by specific queries
I downloaded the slow query log file from Aurora Mysql. I want to playback these queries but separate them to just writes and reads. So a tool to extract only selects, or Inserts+Updates would be nice

edmamerto
- 7,605
- 11
- 42
- 66
0
votes
1 answer
Unable to login as root in mysql
I've been trying out all solutions mentioned in google for this problem to no avail. This website is built using bitnami wordpress stack in AWS. All I want to do is to log slow query. I only have wp-config user credentials to login in to mysql. But…

112233
- 2,406
- 3
- 38
- 88