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
MySQL's EXPLAIN INSERT unavailable: how to understand if INSERT is slow or not?
Initially I'm trying to find slow queries among my scripts. And one of the things that bothering me is INSERT queries as I have couple of indexes in the table (as I can understand insert will not be instantaneous in this case as the indexes should…

Vlada Katlinskaya
- 991
- 1
- 10
- 26
0
votes
1 answer
Does MySQL have query queues and what's behind query_time in the slow log?
what timestamps are used for calculating the query_time parameter in the mysql slow query log? Can't find any definition of that parameter.
Only thing i found is
The time to acquire the initial locks is not counted as execution time.
from:…

Korbinian Grimme
- 13
- 5
0
votes
1 answer
mysql: slow queries log: sleep(60)?
I am trying to understand what is causing my lamp server to timeout a few times a day since four days, after running fine for 417 days.
Looking at running processes top may point to mysql. So I looked in the slow queries log, and only found…

pixeline
- 17,669
- 12
- 84
- 109
0
votes
1 answer
MySQL general and slow query logs not working
I am attempting to get table-based general and slow query-logging working on my local machine. It works alright to file, but I really prefer to go straight to a table so I can use numerous analysis queries I've written over the years.
Here's what…

reustmd
- 3,513
- 5
- 30
- 41
0
votes
3 answers
How to speed up select in 3 joint tables
SELECT it.uid,it.Name,COALESCE(sum(i.Qty),0)-COALESCE(sum(s.Qty),0) as stock
FROM items it
left outer join sales_items s on it.uid=s.ItemID
left outer join inventory i on it.uid=i.uid
group by s.ItemID,i.uid,it.UID;
This is my query. This query…

Faztrick Fazil Pv
- 264
- 3
- 10
0
votes
1 answer
Understanding MySQL's slow query log format
I'm reading MySQL's slow query log and it's:
# Time: 141004 12:30:47
# User@Host: dbuser[dbuser] @ localhost [127.0.0.1] Id: 1959
# Query_time: 0.017325 Lock_time: 0.000112 Rows_sent: 75 Rows_examined: 22146
SET timestamp=1412413247;
SELECT…

Mehran
- 15,593
- 27
- 122
- 221
0
votes
1 answer
MySQL Explain has different row count than slow query log
I have this entry in slow query log:
# User@Host: user[host] @ [ip]
# Thread_id: 1514428 Schema: db Last_errno: 0 Killed: 0
# Query_time: 2.795454 Lock_time: 0.000116 Rows_sent: 15 Rows_examined: 65207 Rows_affected: 0 Rows_read: 65207
#…

codefreak
- 6,950
- 3
- 42
- 51
0
votes
1 answer
slow query mysql didn't find the right index
I've got a "slow query" and didn't find the "right" index to avoid the slow query.
The query is :
SELECT c.uid FROM tx_gwcalendar_competition c,tx_gestionprofildb_discipline d WHERE c.hidden=0 and c.deleted=0 and c.discipline=d.uid and…

Mitchum
- 107
- 2
- 16
0
votes
0 answers
Joomla session table (ostensibly) causing massively slow MySQL queries
I'm seeing intermittent load spikes on my server, which correspond with a bunch of entries in MySQL's slow query log of the form:
# Time: 140326 21:00:40
# User@Host: admin[admin] @ localhost []
# Query_time: 14.713922 Lock_time: 0.000035…

Jeremy Warne
- 3,437
- 2
- 30
- 28
0
votes
0 answers
MySQL does not log slow queries according to my.cnf
I have mysql 5.1.69-log:
and this settings according to /etc/my.cnf:
slow-query-log = 1
slow-query-log-file = /var/log/mysqld_slow.log
log-queries-not-using-indexes = 1
long_query_time = 1
also checked mysql @@global settings:
@@global.log_output =…
user973254
0
votes
3 answers
How do I test the real execution time of a query?
I get one slow query in Mysql slow query log. Mysql slow query log shows the query need more than 4 seconds to execute.
I run this query in phpmyadmin, it takes 3 seconds. When I run it again, it takes only 0.0002 seconds. I guess there is a DB…

Tester
- 798
- 2
- 12
- 32
0
votes
2 answers
Select_full_join number that keep increasing
I'm stuck for a while now, with a Select_full_join number that keep increasing.
I'm using "log-queries-not-using-indexes", I looked at the mysql-slow.log and I found a lot of querys like this one :
# Time: 131106 16:44:51
# User@Host: XXX @…

Deu
- 1
- 2
0
votes
1 answer
mysql slow log query details about Query_time
I am using mysql : 5.5.31-0ubuntu0.12.04.1-log (Ubuntu) and I enabled slow log query ,slow log query time set is 2 sec
for details :
show variables like 'slow_launch_time';
+------------------+-------+
| Variable_name | Value…

Rajnish
- 1,311
- 4
- 14
- 23
0
votes
1 answer
Log MySQL slow query in real-time
I would like to know if it is possible to log (or detect in another way) a query that is taking too much time to execute as soon as it reached the long_query_time. Because MySQL only logs slow queries when they finished executing.
I know I can see…

Raphael Royer-Rivard
- 2,252
- 1
- 30
- 53
0
votes
1 answer
Understanding a Slow Query
I enabled slow query log for my mySQL to observe the slow queries that take more than 10 seconds to be executed. Then I found only one query that is being logged in the mysql.slow_log table. That is:
SELECT `e`.*, IF(at_is_active.value_id > 0,…

Nuhil Mehdy
- 2,424
- 1
- 21
- 23