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
2
votes
3 answers

MySql Left Join very slow query

i have 2 tables of about 3000/4000 rows. I need to make a relation using Left Join for filter the results by searching a text or datetime. I need also to count a total row for pagination. When i run the query is epic slow, consider about 40/45…
2
votes
2 answers

MySQL Slow Query Lock_time = years?

I have seen a lot of slow query logs, but never one like this: /usr/sbin/mysqld, Version: 5.1.46-log (SUSE MySQL RPM). started with: Tcp port: 3306 Unix socket: /var/run/mysql/mysql.sock Time Id Command Argument #…
jerryrig
  • 125
  • 11
2
votes
1 answer

Mysql: order by two column, use filesort

I have trouble ordering two columns. EXPLAIN SELECT * FROM articles WHERE option <>0 AND deleted=0 ORDER BY date_added DESC, category_id DESC LIMIT 25 OFFSET 500 id select_type table type possible_keys key key_len ref …
Pionas
  • 346
  • 1
  • 4
  • 15
2
votes
1 answer

Inserting to Sqlite is slow

I am new to Database. I am tying to insert 22000 word to a sqlite DB but it is taking forever to complete for (int i=0;i
Al-Alamin
  • 1,438
  • 2
  • 15
  • 34
2
votes
2 answers

MySql query taking long time

I have the following tables: Table 1 : Contacts Fields : id first_name Values : 1 Reeta 2 Rohan 3 John Table 2 : email (it contains contact_id of contacts table) Fields : id contact_id email_address Values : 1 1 r@gmail.com 2 …
user3286692
  • 383
  • 1
  • 5
  • 23
2
votes
2 answers

How to get Mysql comments to show up in the slow-log or processlist?

I'm using the mysql slow query log and SHOW PROCESSLIST; to debug some slow queries. MySQL allows comments to be added with the standard /* ... */ syntax. I was hoping by adding a comment in front of my query, it will be easier to spot the origin of…
Tom
  • 14,041
  • 16
  • 64
  • 80
2
votes
1 answer

How to load and execute query log on mysql server?

Hi i'm new on this site and i thank you all right now for the help you guys are hopefully going to give me. I am also new to the mysql enviroment. So, i have been told by my professor to find some tools which given in input log files (general or…
rake05
  • 21
  • 1
2
votes
4 answers

MYSQL higher LIMIT offset slow the query

I have the following Mysql query. It is a slow query and will take around 3 seconds to finish. message_id is the primary key. The problem of this is the high LIMIT offset LIMIT 85075, 25. SELECT * FROM `phorum_messages` WHERE 1 and `catergory` >=0…
user503853
2
votes
2 answers

Why are these MySQL queries so slow?

I don't understand why the following queries show up in slow query log with query time from 12 to 20 seconds. UPDATE `wp_postmeta` SET `meta_value` = '35' WHERE `post_id` = 1267 AND `meta_key` = 'views' UPDATE `wp_postmeta` SET `meta_value` = '32'…
ericn
  • 12,476
  • 16
  • 84
  • 127
2
votes
1 answer

MySQL query optimization [join]

I have next query SELECT i.*, gu.* vs.* FROM common.global_users gu LEFT JOIN common.global_users_perms gup ON (gu.global_user_id=gup.global_user_id) LEFT JOIN p.individuals i ON (gup.parent_id = i.member_id) LEFT JOIN p.vs ON…
user1016265
  • 2,307
  • 3
  • 32
  • 49
2
votes
2 answers

pt-query-digest is coming up with no results and "0 total, 1 unique". Any idea how to solve that?

It appears for some of our logs, the percona toolkit pt-query-digest tool works fine, but for others we get the following output: # Files: /.../mysqld_slow.log # Overall: 0 total, 1 unique, 0 QPS, 0x concurrency ______________________ # Attribute …
btelles
  • 5,390
  • 7
  • 46
  • 78
2
votes
3 answers

how to determine slow queries?

My site is experiencing a really slow loading time. I have suspected that it might be javascript or php that causes longer loading time but i have tested my site in YSlow and its grade is B which i think is not bad. Now i want to check my database…
Jayson O.
  • 485
  • 1
  • 6
  • 20
2
votes
4 answers

Why does mysql slow log reports these non-slow queries

My mysql server has long_query_time = 2 configured but I still see these queries reported in slow query log that seem fast: # Time: 120730 5:06:41 # User@Host: @ [] # Query_time: 0.000412 Lock_time: 0.000060 Rows_sent: 5 …
ekeren
  • 3,408
  • 3
  • 35
  • 55
2
votes
2 answers

mysql log_queries_not_using_indexes works wrong?

I have following procedure: CREATE PROCEDURE getProjectTeams(IN p_idProject INTEGER) BEGIN SELECT idTeam, name, workersCount, confirmersCount, isConfirm FROM Teams JOIN team_project USING (idTeam) WHERE idProject = p_idProject; END $$ And here…
Joe
  • 2,551
  • 6
  • 38
  • 60
1
vote
2 answers

mysql query inner join slowing

I have the following database structure: CREATE TABLE IF NOT EXISTS `business` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `address` varchar(255) NOT NULL, `city` varchar(255) NOT NULL, `state` varchar(255) NOT NULL, `postal` int(11) NOT…
hodl
  • 1,420
  • 12
  • 21
1 2
3
13 14