Jump to content

Fixing slow queries in the Slow Query Log?


random1

Recommended Posts

I have been developing a database in MySQL using the InnoDB starge engine.

 

I'm trying to iron out slow performing queries I have in my database.

 

My Slow Query Log contains:

 

# Time: 120716 22:27:51
# User@Host: MYUSERNAME[MYUSERNAME] @ localhost [127.0.0.1]
# Query_time: 0.002929  Lock_time: 0.002929 Rows_sent: 21  Rows_examined: 21
use webman;
SET timestamp=1342441671;
SELECT `language_string_id`, `language_string_name`,`language_string_text` FROM `language_korean` ORDER BY `language_string_id`;
# User@Host: MYUSERNAME[MYUSERNAME] @ localhost [127.0.0.1]
# Query_time: 0.002929  Lock_time: 0.002929 Rows_sent: 19  Rows_examined: 47
SET timestamp=1342441671;
SELECT * FROM `view_language_list`;
# User@Host: MYUSERNAME[MYUSERNAME] @ localhost [127.0.0.1]
# Query_time: 0.000000  Lock_time: 0.000000 Rows_sent: 21  Rows_examined: 21
SET timestamp=1342441671;

 

Both Queries:

 

1) SELECT `language_string_id`, `language_string_name`,`language_string_text` FROM `language_korean` ORDER BY `language_string_id`;

2) SELECT `language_wms`.`language_id` AS `language_id`,`language_wms`.`language_name` AS `language_name`,`language_wms`.`language_description` AS `language_description`,`language_wms`.`language_text_direction` AS `language_text_direction` from `language_wms` where `language_wms`.`language_status_id` order by `language_wms`.`language_ordering`,`language_wms`.`language_name` 

 

I ran EXPLAIN on them and got:

 

1) id;select_type;table;type;possible_keys;key;key_len;ref;rows;Extra

1;SIMPLE;language_korean;index;;PRIMARY;8;;21;

 

2) id;select_type;table;type;possible_keys;key;key_len;ref;rows;Extra

1;SIMPLE;language_wms;ALL;;;;;28;Using where; Using filesort

 

Is there a way to speed up these queries and get them out of appearing in the slow query log?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.