Questions tagged [slow-log]

113 questions
32
votes
5 answers

Where can I find the mysql slow log?

Just as the title says, where can I see it ? Are there any config options for it ( like how many ms would determine if a query is slow or not ) ?
poelinca
  • 2,865
  • 3
  • 22
  • 15
20
votes
2 answers

Write a slow query to test slow query logging?

Is there a simple query that would take > 2 sec so that I can test the slow query logger? I am looking for something like a generic recursive or iterative statement.
David LeBauer
  • 3,162
  • 8
  • 32
  • 34
20
votes
1 answer

what is "planSummary: IDHACK"?

This Query scans only one document and returns only one document. But this is very slow: 2017-05-22T07:13:24.548+0000 I COMMAND [conn40] query databasename.collectionname query: { _id: ObjectId('576d4ce3f2d62a001e84a9b8') } planSummary: IDHACK…
Sybil
  • 2,578
  • 6
  • 34
  • 61
15
votes
1 answer

Slow Queries Not Logging

I am attempting to enable slow query logging on our server in order to identify any queries that could use optimization. Sounds simple enough, however my file is not being written to. I get no errors or anything of the like, it just doesn't seem to…
TheMethod
  • 275
  • 1
  • 2
  • 6
15
votes
2 answers

Identify slow query without slow query logs in mysql server

I am wondering is there any other way to to check our slow queries without logging slow query. Suppose, I have a highily busy server can't afford to log much to save memory and I/Os. Then, is there any other way available to check if I have a slow…
Astha
  • 253
  • 1
  • 2
  • 6
14
votes
3 answers

How do I output MySQL logs to syslog?

I want to use syslog for logging MySQL(5.1.41) on Ubuntu(10.04 LTS). I found information that output error log to syslog. [mysqld_safe] syslog But I want to use syslog for logging general logs and slow query logs. Please advise me how to write…
inohiro
  • 345
  • 2
  • 3
  • 9
14
votes
1 answer

Enabling "log_queries_not_using_indexes" disables "long_query_time"?

I noticed that, in Mysql, when enabling log_queries_not_using_indexes, slow_query_log and long_query_time, the generated slow query log file will contain a lot of queries even if the query time is far less than long_query_time. It seems that once…
Dante WWWW
  • 243
  • 1
  • 2
  • 5
13
votes
2 answers

format of mysql query log

What is the format of the mysql query log? In particular, for lines like: 133 Query commit 133 Query rollback What does '133' stand for? And is it true that each line represents a round trip communication to the database (i.e., they are not…
JRR
  • 505
  • 2
  • 6
  • 10
12
votes
3 answers

MySQL replication - slave is continuously lagging behind master

I am using MySQL-5.1.50 with a Master-slave replication setup. Most of the time the slave is lagging behind the master. When I run show processlist;, there is no query that's taking a long time. I enabled slow_log as well. However, it does not…
adeela sahar
  • 121
  • 1
  • 1
  • 3
12
votes
5 answers

Delete Slow Query Log File

I was logging slow queries of my system. Now I have few queries to be optimized and reset the global slow_query_log variable to 0. Now I want to delete slow query log file mysqld-slow.log. can anyone tell me what is the standard way to do this ? I…
Chandan
  • 381
  • 1
  • 2
  • 12
8
votes
3 answers

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
  • 183
  • 1
  • 7
8
votes
2 answers

MySQL commits taking time

We are facing an issue, where at certain times there are number of commits that takes a more than a second. The time interval for this is not fixed. Our application sends thousands of commits but at some instance the commits with exact same…
Ahmed
  • 195
  • 1
  • 2
  • 8
7
votes
3 answers

Replay (re-execute) MySQL SELECT queries from a log file

MySQL Benchmarking I would like to evaluate the performance of a different MySQL instance by re-executing real queries from log files. I am aware of tools like mysqlslap, that produces random and autogenerated queries, but I would rather like to…
Stefan
  • 231
  • 3
  • 8
6
votes
5 answers

MySQL slow query log: huge query time, no lock time, minuscule number of rows scanned

I have a slow query log item with the following: Query_time: 55 Lock_time: 0 Rows_sent: 739 Rows_examined: 739 No one in my group can explain it besides a guess about packet loss. Is there a common cause or set of causes for result like the…
rsimoes
  • 233
  • 3
  • 8
6
votes
2 answers

MySQL Slow Query Log - SELECT /*!N SQL_NO_CACHE */

Using mysqldumpslow, I can see that the most common entries in a MySQL slow query log are of the following form: SELECT /*!N SQL_NO_CACHE */ from wp_posts (or wp_comments). I can't seem to find much information about what this statement means and…
anu
  • 162
  • 1
  • 6
1
2 3 4 5 6 7 8