MySQL Query使服务器非常慢

时间:2017-05-01 15:43:12

标签: mysql wordpress

我有这个观点,使我的MySQL服务器运行速度很慢,甚至断开连接。有谁有想法为什么?

select 
u1.`ID` AS `ID`,
u1.`post_date` AS `post_date`,
u1.`processed` AS `processed`,
m1.`meta_value` AS `from`,
m2.`meta_value` AS `subject`
from `wp`.`wp_posts` u1
JOIN `wp`.`wp_postmeta` m1 ON (m1.`meta_key` = '_from_name')
JOIN `wp`.`wp_postmeta` m2 ON (m2.`meta_key` = '_subject')
where (u1.`post_type` = 'flamingo_inbound' AND u1.processed = 0 )

union 

select 
u1.`ID` AS `ID`,
u1.`post_date` AS `post_date`,
u1.`processed` AS `processed`,
m1.`meta_value` AS `from`,
m2.`meta_value` AS `subject`
from `wp2`.`wp_posts` u1
JOIN `wp2`.`wp_postmeta` m1 ON (m1.`meta_key` = '_from_name')
JOIN `wp2`.`wp_postmeta` m2 ON (m2.`meta_key` = '_subject')
where (u1.`post_type` = 'flamingo_inbound'AND u1.processed = 0 )
order by `ID` desc

0 个答案:

没有答案