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?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.