我有一个很长但很简单的查询,似乎要花费很长时间才能返回结果(超过2秒)。
下面是该查询:简单查询需要很长时间才能执行
SELECT *
FROM `posts`
WHERE (`title` = 'Surprise Kanye West performance ends in fans\' disappointment'
AND `content` = '<p>It was an only-in-New-York moment: the announcement of a surprise Kanye West performance that drew throngs of people to the streets of Manhattan in the middle of the night. But instead of a concert to remember, the night ended with a hoard of disappointed fans and allegations that police used pepper spray to disperse them.<br/>Popular: <a href=\"http://podcast.cnn.com/anderson-cooper-360/episode/all/065F3vnWEzaATm/ac360-special-2016-01-07.html\" rel=\"noreferrer\" target=\"_blank\">Guns in America</a> | <a href=\"http://podcast.cnn.com/anderson-cooper-360/episode/all/09mJDnGHBvEtl7/6cgs1a.1-1.html\" rel=\"noreferrer\" target=\"_blank\">Sanders Demands Clinton Apologize</a> | <a href=\"http://podcast.cnn.com/fareed-zakaria-gps/episode/all/3m0KewVpkReuAh/gfaw6g.1-1.html\" rel=\"noreferrer\" target=\"_blank\">Blindsided: How ISIS Shook The World</a><br/></p>'
AND `poster` = '')
OR (`title` = 'Surprise Kanye West performance ends in fans\' disappointment'
AND `url` = 'http://www.cnn.com/2016/06/06/entertainment/kanye-west-surprise-concert-canceled/index.html'
AND `poster` = '')
OR `url` = 'http://www.cnn.com/2016/06/06/entertainment/kanye-west-surprise-concert-canceled/index.html' LIMIT 1;
下面是该表中的列:
http://i.imgur.com/w9qcpH2.png
我还没有设置任何索引上的任一列是否有帮助。我该怎么做才能使这个查询运行得更快?
道歉,我编辑了我的帖子,以清楚地说明没有索引已应用于任何列。 – user6461291
关于以'EXPLAIN'为前缀的查询,我已经试过了,但我不确定我能从给出的信息中得出什么结论(供将来使用):http://i.imgur.com/TV5D0YN.png – user6461291
也,我是否也会在'(标题,网址,海报)'上添加复合索引? – user6461291