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

196 questions
3
votes
2 answers

How to analyse MySQL Slow Query Log or MySQL General Query Log?

Analysing logs is a major problem. If you have a legacy code and hundreds and thousands of queries running, you are bound to be confused by what to improve and where to improve and how much to improve because there is always a tradeoff between how…
MontyPython
  • 2,906
  • 11
  • 37
  • 58
3
votes
1 answer

slow query log contains queries which are less than the time specified in long_query_time parameter

I have set the long_query_time parameter to 2 ( which means two seconds) i think. But i can see many queries in my slow log file which is below the 2 seconds. Actually it must populate the files which are more than 2 seconds only know? The below is…
Prem Kumar
  • 117
  • 1
  • 11
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…
3
votes
1 answer

Why would "SHOW GLOBAL STATUS" be appearing in the slow log?

I was routinely reviewing the slow log on one of my MySQL replication servers and found that the most common slow query was SHOW GLOBAL STATUS running at an average of 914s. I already know why it is there (a monitoring probe is generating the…
Robin
  • 495
  • 1
  • 5
  • 18
3
votes
1 answer

Mysql slow query log is logging faster queries

I've setup mysql slow query log on my database server and set the long query time to 5. Just checked the log and its logging queries that take only milliseconds. Anyone know why that would be?, here's some of the log. The last query isn't exactly…
fatlinesofcode
  • 1,647
  • 18
  • 22
3
votes
2 answers

Tools or patch for Ruby Sequel or ORM instrumenting SQL queries for slow query log analysis

We have MySQL slow query logs from a suite of applications, mostly in Ruby, some using Rails ActiveRecord, others using Sequel. We'd love to be able to easily track a particular (MySQL) slow query back to the code which generated it. Is there a…
Jim Dennis
  • 17,054
  • 13
  • 68
  • 116
2
votes
1 answer

mariadb slow query not logged

As the title suggests, no log is recorded in the log file even though the related settings have been completed. slow_query_log_file = /var/log/mysql/mariadb-slow.log slow_query_log = 1 long_query_time = 1 log_slow_rate_limit =…
pat-bung
  • 33
  • 5
2
votes
3 answers

MySQL query SLOW Don't know how to optimize

MySQL query SLOW don’t know how to optimize I think I m fine with hardware 60GB RAM 10 Cores SSD Hi I m having a big issue with this query running slow on Mysql they query is below: # Thread_id: 1165100 Schema: back-Alvo-11-07-19 QC_hit: No #…
FerPaqui
  • 21
  • 4
2
votes
0 answers

Random slow response time making app crash on beanstalk

We have a php app using laravel on elastic beanstalk that's been running for almost 2 years. Since the last 2 weeks(almost 3) we've been having random really high response time which cause the Database connections to become stuffed which then cause…
2
votes
1 answer

Disable Query_Log() before executing some queries in Laravel

I am developing web base application using Laravel 5.6 . There are many database queries to execute. As a security purpose I try to store my all queries into a database table as Query log. I have uses AppServiceProvider service provider to do that.…
Pushpamal
  • 107
  • 2
  • 16
2
votes
1 answer

MySQL order by makes query slow solved, but not sure why

I have the following query: select * from `twitter_posts` where `main_handle_id` in ( select `twitter`.`main_handle_id` from `users` inner join `twitter` on `twitter`.`user_id` = `user`.`id` where …
jlos
  • 1,010
  • 1
  • 8
  • 12
2
votes
0 answers

`administrator command: Prepare` is top offending query in Perona's pt-query-digest

I am seeing the worst performing query as administrator command: Prepare over the last 12 hours where we saw a huge CPU usage spike in MySQL today. All of the usages of this query took 10+ seconds to execute. We are using Percona pt-query-digest…
phirschybar
  • 8,357
  • 12
  • 50
  • 66
2
votes
3 answers

MySQL SUM Query is extremely slow

There is a table called transactions with ~6 million rows. Below query counts the current user balance. Here is the log after I enabled slow_query_log = 'ON' : # Time: 170406 9:51:48 # User@Host: root[root] @ [xx.xx.xx.xx] # Thread_id: 13 Schema:…
Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
2
votes
2 answers

Huge time in slow query log (MariaDB)

When I run the slow query log analyzer, I see huge time of requests in seconds. I tried to execute these requests manually, they are executed very fast(0.01sec). What could be the problem? mysql Ver 15.1 Distrib 10.1.9-MariaDB, for Linux (x86_64)…
avj83
  • 33
  • 4
2
votes
1 answer

How to extract mysql slow query log of particular date from large file?

I have a large slow query log file. i want to check the queries of a particular date in last week. Its very tough to scan the file and go the particular date. Is there any command to extract the slow log queries of a particular date from that large…
Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81
1
2
3
13 14