길지 만 간단한 쿼리를 사용하면 결과를 반환하는 데 오랜 시간이 걸릴 것입니다 (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
또한 ,'(title, url, poster)'에 복합 색인을 넣을 수 있습니까? – user6461291