DB getting locked out because of query
I am having a query lock the db while
| 3240750 | youthspe_ysjobs | localhost | youthspe_ysjobbank | Query | 89 | Copying to tmp table | SELECT hudk1o_posts.*, hudk1o_p2p.* FROM hudk1o_posts LEFT JOIN hudk1o_postmeta ON hudk1o_posts.ID = hudk1o_postmeta.post_id INNER JOIN hudk1o_p2p WHERE 1=1 AND hudk1o_posts.post_type IN ('transaction', 'job_listing', 'discount_coupon') AND (hudk1o_posts.post_status <> 'trash' AND hudk1o_posts.post_status <> 'auto-draft') OR (hudk1o_posts.post_title LIKE '%%') OR (hudk1o_posts.post_content LIKE '%%') AND (hudk1o_p2p.p2p_type = 'order-connection' AND hudk1o_posts.ID = hudk1o_p2p.p2p_to AND hudk1o_p2p.p2p_from IN (SELECT hudk1o_posts.ID FROM hudk1o_posts LEFT JOIN hudk1o_postmeta ON hudk1o_posts.ID = hudk1o_postmeta.post_id WHERE 1=1 AND hudk1o_posts.ID IN (11868) AND hudk1o_posts.post_type IN ('transaction', 'job_listing', 'discount_coupon') AND (hudk1o_posts.post_status <> 'trash' AND hudk1o_posts.post_status <> 'auto-draft') OR (hudk1o_posts.post_title LIKE '%%') OR (hudk1o_posts.post_content LIKE '%%') GROUP BY hudk1o_posts.ID ORDER BY hudk1o_posts.post_date DESC )) GROUP BY hudk1o_posts.ID ORDER BY hudk1o_posts.post_date DESC |
| 3240902 | youthspe_ysjobs | localhost | youthspe_ysjobbank | Query | 88 | Copying to tmp table | SELECT hudk1o_posts.*, hudk1o_p2p.* FROM hudk1o_posts LEFT JOIN hudk1o_postmeta ON hudk1o_posts.ID = hudk1o_postmeta.post_id INNER JOIN hudk1o_p2p WHERE 1=1 AND hudk1o_posts.post_type IN ('transaction', 'job_listing', 'discount_coupon') AND (hudk1o_posts.post_status <> 'trash' AND hudk1o_posts.post_status <> 'auto-draft') OR (hudk1o_posts.post_title LIKE '%%') OR (hudk1o_posts.post_content LIKE '%%') AND (hudk1o_p2p.p2p_type = 'order-connection' AND hudk1o_posts.ID = hudk1o_p2p.p2p_to AND hudk1o_p2p.p2p_from IN (SELECT hudk1o_posts.ID FROM hudk1o_posts LEFT JOIN hudk1o_postmeta ON hudk1o_posts.ID = hudk1o_postmeta.post_id WHERE 1=1 AND hudk1o_posts.ID IN (11876) AND hudk1o_posts.post_type IN ('transaction', 'job_listing', 'discount_coupon') AND (hudk1o_posts.post_status <> 'trash' AND hudk1o_posts.post_status <> 'auto-draft') OR (hudk1o_posts.post_title LIKE '%%') OR (hudk1o_posts.post_content LIKE '%%') GROUP BY hudk1o_posts.ID ORDER BY hudk1o_posts.post_date DESC )) GROUP BY hudk1o_posts.ID ORDER BY hudk1o_posts.post_date DESC |
Looks as though it's copy the tmp because it's sql query. Can someone help in determining what is causing this to happen. the prefix of the table is hudk1.
| SELECT hudk1o_posts.*, hudk1o_p2p.* FROM hudk1o_posts LEFT JOIN hudk1o_postmeta ON hudk1o_posts.ID = hudk1o_postmeta.post_id INNER JOIN hudk1o_p2p WHERE 1=1 AND hudk1o_posts.post_type IN ('transaction', 'job_listing', 'discount_coupon') AND (hudk1o_posts.post_status <> 'trash' AND hudk1o_posts.post_status <> 'auto-draft') OR (hudk1o_posts.post_title LIKE '%%') OR (hudk1o_posts.post_content LIKE '%%') AND (hudk1o_p2p.p2p_type = 'order-connection' AND hudk1o_posts.ID = hudk1o_p2p.p2p_to AND hudk1o_p2p.p2p_from IN (SELECT hudk1o_posts.ID FROM hudk1o_posts LEFT JOIN hudk1o_postmeta ON hudk1o_posts.ID = hudk1o_postmeta.post_id WHERE 1=1 AND hudk1o_posts.ID IN (11861) AND hudk1o_posts.post_type IN ('transaction', 'job_listing', 'discount_coupon') AND (hudk1o_posts.post_status <> 'trash' AND hudk1o_posts.post_status <> 'auto-draft') OR (hudk1o_posts.post_title LIKE '%%') OR (hudk1o_posts.post_content LIKE '%%') GROUP BY hudk1o_posts.ID ORDER BY hudk1o_posts.post_date DESC )) GROUP BY hudk1o_posts.ID ORDER BY hudk1o_posts.post_date DESC |
| 3240902 | youthspe_ysjobs | localhost | youthspe_ysjobbank | Query | 96 | Waiting for table level lock | SELECT meta_id FROM hudk1o_postmeta WHERE meta_key = 'total_price' AND post_id = 11868