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
1
vote
1 answer

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
  • 1,728
  • 5
  • 17
  • 36
1
vote
0 answers

MySql BigQuery with IN(1,3,8...N) optimization

We have a MySQL database with a large table(30000000 rows) where the banner are. We have a query such as: SELECT * FROM banner WHERE banner.id IN (1,3,8...N); The problem is that number in IN is large which result in slow query. I want separate the…
kukka
  • 121
  • 7
1
vote
1 answer

Simple SELECT query is slow with large table

I have a table with the following structure SHOW CREATE TABLE data_temperature; CREATE TABLE `data_temperature` ( `temperature_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `data_id`…
Nick Coons
  • 3,682
  • 1
  • 19
  • 21
1
vote
1 answer

Mysql slow log: simple select query takes 26 seconds

I have a simple table, which is using InnoDB: tag_id int(20), primary tag varchar(50) There are only 106 tags in the table and sometimes this simple select query is taking 10s, 16s, 30s or more: # Query_time: 26 Lock_time: 0 Rows_sent: 106 …
Pyerro
  • 13
  • 3
1
vote
2 answers

How to find which is the really slow query?

I am testing a web page (wordpress) , I have this log but I cant understand which is the really slow query here is the link to read the queries of my website , please find time to tell me what is the dangerous query in this log that kills my…
gpweb
  • 11
  • 7
1
vote
1 answer

MySQL slow query log contains empty statements

Percona server (mysql Ver 14.14 Distrib 5.5.40-36.1, for debian-linux-gnu (x86_64)) besides standart expected queries started logging following statements into slow query log. Statements get logged each second and come from percona agent. How can I…
Kaspars Foigts
  • 159
  • 1
  • 4
1
vote
2 answers

MySQL select with multiple many to many joins causing very slow query

Using the following table structure: Items (~20,000 records) item_id Properties (~30 records) property_id Item_properties (~40,000 records) id property_id item_id A user can choose to filter items by a number of fields in the items table…
M1ke
  • 6,166
  • 4
  • 32
  • 50
1
vote
0 answers

How to detect MYSQL slow queries when using rackspace Database

Is there any easy way to see the slow queries in Rackspace MySQL? I tried to follow their instructions But it is too complicated...
Daniel Cukier
  • 11,502
  • 15
  • 68
  • 123
1
vote
1 answer

Mysql IN operator taking long time to execute

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
1
vote
1 answer

Reproduce slow_query_log output for a single query without enabling slow_query_log

How do you reproduce the output for a single query without enabling the slow_query_log? I'm looking for rows_examined.
Josh Unger
  • 6,717
  • 6
  • 33
  • 55
1
vote
0 answers

Optimize this sql query (slow query)

I have this query: SELECT DATE( wp_posts.post_date ) post_date, wp_posts.id, wp_posts.post_title, wp_posts.post_status, wp_posts.guid, COUNT( …
1
vote
1 answer

Mysql LEFT JOIN is slow

I have the below code, which returns 10 entries. It seems slow now. SELECT a.id , a.patient_name , a.phone , p2.card_number FROM patients as a LEFT JOIN patient_insurance as p2 ON a.id=p2.patient WHERE a.patient_name LIKE…
Vish K
  • 127
  • 1
  • 2
  • 11
1
vote
1 answer

Mysql Slow Query group concat with subquery

I have following query select `cs`.sku , group_concat( IF( ( ( SELECT count(id_catalog_category) from `catalog_category` where lft <=…
1
vote
3 answers

Wordpress slow query

i have a wordpress blog and my shared hosting companny warned me about slow activity. In my mysql slowlog.log i have essentialy queries that take about 2 an d 3 (i think seconds not milliseconds) here is the query in the log : # Query_time: 2 …
Mokrane
  • 300
  • 3
  • 14
1
vote
0 answers

Fast query come to slow log [mysql]

Sometimes I see in slow log, query which should not be there. I know such query(ies) execute many times per day and it is fast enough, when I analyze slow log I see that this particular query droped to log only at once, ### 1 Query ### Total…
user1016265
  • 2,307
  • 3
  • 32
  • 49