Slow mla_gallery
-
Hi. I am using this shortcode:
mla_gallery attachment_category="fun" size="vk-thumb" columns="0" mla_itemwidth="24%"?order="ASC"
It produces this sql:
SELECT wp_posts.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_posts AS p2 ON (p2.ID = p2.ID) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (235) ) AND (wp_posts.post_mime_type LIKE 'image/%') AND wp_posts.post_type = 'attachment' AND (((wp_posts.post_status = 'inherit') OR (wp_posts.post_status = 'inherit' AND (p2.post_status = 'inherit')))) GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order ASC, wp_posts.ID ASC
It takes 4-6 seconds to query. If I just remove ‘LEFT JOIN wp_posts AS p2 ON (p2.ID = p2.ID)’, nothing changes in results, but now it takes 0.01 sec, like it should.
Is there some arcane meaning in joining ON (p2.ID = p2.ID) , on the same table?
If not, could you please fix it?
ps: temporary speeding it up with post_status=”publish”, it’s still the same, but at least now it’s 1-2 sec.
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Slow mla_gallery’ is closed to new replies.