Hi,
I'm getting issues with slow queries being generated by a table in my database for my app, this query is consistently generating an entry in the slow query log:
# Query_time: 2 Lock_time: 0 Rows_sent: 27 Rows_examined: 958
SELECT `p_id` FROM `products` LEFT JOIN `products_images` ON (`p_id` = `pi_pid`) WHERE `pi_image_mime` IS NULL AND `p_archived` = '0' GROUP BY `p_id`;
an explain query generates this:
1 SIMPLE ls_products ref p_archived p_archived 1 const 866 Using where; Using temporary; Using filesort
1 SIMPLE ls_products_images ref pi_pid pi_pid 4 shop.ls_products.p_id 12 Using where; Not exists
and a desc generates this:
pi_id int(11) NO PRI NULL auto_increment
pi_pid int(11) NO MUL 0
pi_label varchar(255) NO
pi_primary_image tinyint(1) NO 0
pi_sort_order int(11) NO 0
pi_micro_blob mediumblob NO
pi_thumb_blob mediumblob NO
pi_large_blob mediumblob NO
pi_zoom_blob mediumblob NO
pi_image_mime varchar(25) NO
pi_date_added datetime NO 0000-00-00 00:00:00
pi_filename varchar(50) NO
pi_image_label varchar(255) NO
Any ideas ?