Questions tagged [mysql-slow-query-log]

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

174 questions
30
votes
2 answers

Why I could not alter the variable long_query_time variable at runtime

I am using MySQL version 5.1.66. I saw that the long_query_time variable is dynamic, but when I tried set GLOBAL long_query_time=1; After the above operation again I tried mysql> show variables like…
neotam
  • 2,025
  • 1
  • 24
  • 49
22
votes
1 answer

Why does `log_slow_queries` break `my.cnf`?

Why can't I use slow_query_log on MySQL 5.6 on CentOS 6.4? [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock ... ## Logging ## *** THESE LOGS WORK JUST FINE *** log_error =…
Ryan
  • 14,115
  • 29
  • 92
  • 163
14
votes
2 answers

mysql 5.7 log-slow-queries error

I'm trying to enable Slow Query Logging on mysql 5.7 and getting this error: 2016-04-27T14:55:51.934612Z 0 [ERROR] unknown variable 'log-slow-queries=/var/log/mysql-query.log' 2016-04-27T14:55:51.934639Z 0 [ERROR] Aborting In my /etc/my.cnf file I…
Alby
  • 436
  • 1
  • 7
  • 15
14
votes
2 answers

How to interpret slow query log information generated by MySQL?

So my understanding of slow query log is that it logs info about all those queries that took >= time (in secs) that we have set in my.conf file. Now lets take 3 cases of 3 different SELECT queries (against tables with INNODB engine): QUERY I:…
sactiw
  • 20,109
  • 4
  • 35
  • 28
11
votes
1 answer

MySQL slow query log logging fast queries

I'm having an issue where MySQL seems to be logging queries in the slow query log that are faster than the time specified. I've configured MySQL to log the following: Server version:…
wrangler
  • 1,725
  • 1
  • 18
  • 22
8
votes
2 answers

MySQL 100% CPU + Slow query - Not using index properly

I'm using the RDS database from amazon with a some very big tables, and yesterday I started to face 100% CPU utilisation on the server and a bunch of slow query logs that were not happening before. I tried to check the queries that were running and…
8
votes
2 answers

mysql view super slow

this is the query for Unified Medical Language System(UMLS) to find a word related to normalized word. this query result is 165MS, but if I am running VIEW of this same query it is taking 70 sec. I m new to the mysql. Please help me. Query: SELECT…
James Baloni
  • 127
  • 1
  • 3
  • 8
6
votes
1 answer

Trying to isolate pt-query-digest per host

I'm having some difficulty coming up with correct syntax to pull in specific host information for my slow query log file: I'm using the following: sudo pt-query-digest mysql-slow.log --since "2017-05-07 22:00:00" --until "2017-05-08 22:00:00"…
5
votes
4 answers

How to flush data from mysql.slow_log table in mysql?

Hi i am working on MySQL version 5.5, can somebody please help me to clear/flush data from mysql.slow_log tables in mysql ?
Vikrant More
  • 4,510
  • 19
  • 51
  • 84
5
votes
1 answer

MySQL slow query that uses the index and isn't slow when I run it through the profiler

In my slow query log I am seeing slow queries like # Time: 121107 16:34:02 # User@Host: web_node[web_node] @ localhost [127.0.0.1] # Thread_id: 34436186 Schema: test_db Last_errno: 0 Killed: 0 # Query_time: 1.413751 Lock_time: 0.000222 …
4
votes
1 answer

MySQL log-queries-not-using-indexes and UNION false positive or error?

Am activated slow queries log with this parameters: log_slow_queries = /var/log/mysql/mysql-slow.log long_query_time = 10 log-queries-not-using-indexes Now it seems that MySQL is logging only query without index this is a sample of log # Time:…
Zauker
  • 1,976
  • 1
  • 23
  • 32
3
votes
3 answers

Automatic kill/timeout slow queries in MySQL

Is there some configuration that can be done at MySQL side to automatically kill or timeout queries that are extremely slow, say 100 seconds.
Stewie
  • 3,036
  • 2
  • 20
  • 21
3
votes
2 answers

Are full count queries really so slow on a large MySQL InnoDB tables?

We have a large tables with millions of entrys. A full count is pretty slow, see code below. Is this quite common for a MySQL InnoDB table? Is there no way to accelerate this? Even with the query cache it's still "slow". I also wonder, why the count…
3
votes
3 answers

mysql 5.7: Why are 38% of queries missing from the slow query log?

Sporadically we're seeing thousands of queries per second reported by show global status like "Queries" but don't see them in the slow query log with everything enabled, so we can't see what these queries are. Here are (what I think are) the…
Peter V. Mørch
  • 9,433
  • 5
  • 46
  • 65
3
votes
1 answer

Amazon AWS RDS MySQL slow query log

I have Mysql DB on AWS RDS instance, and I have a slow query log with log_queries_not_using_indexes = YES And it is working but almost every 5 seconds, this is what I am seeing in log: SELECT value FROM mysql.rds_heartbeat2; # Time: 150804…
1
2 3
11 12