Widget slowly query in gallery

Affected version
2.1.7

kick

Well-known member
SQL:
SELECT `xf_mg_media_item`.*, `xf_mg_album_Album_1`.*, `xf_mg_category_Category_2`.*, `xf_user_User_3`.*, `xf_attachment_Attachment_4`.*, `xf_attachment_data_Data_5`.*
FROM `xf_mg_media_item`
LEFT JOIN `xf_mg_album` AS `xf_mg_album_Album_1` ON (`xf_mg_album_Album_1`.`album_id` = `xf_mg_media_item`.`album_id`)
LEFT JOIN `xf_mg_category` AS `xf_mg_category_Category_2` ON (`xf_mg_category_Category_2`.`category_id` = `xf_mg_media_item`.`category_id`)
LEFT JOIN `xf_user` AS `xf_user_User_3` ON (`xf_user_User_3`.`user_id` = `xf_mg_media_item`.`user_id`)
LEFT JOIN `xf_attachment` AS `xf_attachment_Attachment_4` ON (`xf_attachment_Attachment_4`.`content_type` = 'xfmg_media' AND `xf_attachment_Attachment_4`.`content_id` = `xf_mg_media_item`.`media_id`)
LEFT JOIN `xf_attachment_data` AS `xf_attachment_data_Data_5` ON (`xf_attachment_data_Data_5`.`data_id` = `xf_attachment_Attachment_4`.`data_id`)
WHERE (IF(`xf_mg_media_item`.`album_id` > 0, `xf_mg_album_Album_1`.`album_state` = 'visible', 1=1)) AND ((`xf_mg_media_item`.`category_id` IN (1, 2)) OR (`xf_mg_media_item`.`category_id` = 0)) AND (`xf_mg_media_item`.`media_state` = 'visible')
ORDER BY `xf_mg_media_item`.`media_date` DESC, `xf_mg_media_item`.`media_id` DESC
Run Time: 0.001498
Select TypeTableTypePossible KeysKeyKey LenRefRowsExtra
SIMPLExf_mg_media_itemALLcategory_id_media_date 2475Using where; Using temporary; Using filesort
SIMPLExf_mg_album_Album_1eq_refPRIMARYPRIMARY4xf_mg_media_item.album_id1Using where
SIMPLExf_mg_category_Category_2ALLPRIMARY 2Using where; Using join buffer (Block Nested Loop)
SIMPLExf_user_User_3eq_refPRIMARYPRIMARY4xf_mg_media_item.user_id1
SIMPLExf_attachment_Attachment_4refcontent_type_id_datecontent_type_id_date31const,xf_mg_media_item.media_id1Using where
SIMPLExf_attachment_data_Data_5eq_refPRIMARYPRIMARY4xf_attachment_Attachment_4.data_id1
explain:
idselect_typetablepartitionstypepossible_keyskeykey_lenrefrowsfilteredExtra
1SIMPLExf_mg_media_itemNULLALLcategory_id_media_dateNULLNULLNULL247533.09Using where; Using temporary; Using filesort
1SIMPLExf_mg_album_Album_1NULLeq_refPRIMARYPRIMARY4xf_mg_media_item.album_id1100.00Using where
1SIMPLExf_mg_category_Category_2NULLALLPRIMARYNULLNULLNULL2100.00Using where; Using join buffer (Block Nested Loop)
1SIMPLExf_user_User_3NULLeq_refPRIMARYPRIMARY4xf_mg_media_item.user_id1100.00NULL
1SIMPLExf_attachment_Attachment_4NULLrefcontent_type_id_datecontent_type_id_date31const,xf_mg_media_item.media_id1100.00Using where
1SIMPLExf_attachment_data_Data_5NULLeq_refPRIMARYPRIMARY4xf_attachment_Attachment_4.data_id1100.00NULL
 
Top