0
我使用MySQL和我有一些性能問題絲毫此查詢:優化慢MySQL查詢
SELECT s.ID, headline, uId, teaser, hide_image_archiv, image, image_caption, date_format(cDate, '%d.%m.%Y | %H:%i Uhr') as date, channelid, channel_article.name FROM
(SELECT article.ID, uId, headline, teaser, cDate, image, image_caption, channelid, hide_image_archiv
FROM article
inner join article_cCountry on article.ID = ID1 and ID2 = 1
WHERE sDate < now()
and (eDate > now() or eDate = 0)
and released = 'TRUE'
and (uId in (select ID from user where released = 1) or uId = 0)
ORDER BY cDate DESC) AS s, channel_article where channelid = channel_article.ID AND channelid = 8 order by cDate desc LIMIT 3
說明:
它需要大約0.30 - 0.40秒
有什麼方法可以優化它嗎?
驚人)0.0019秒 – grundig
我試着與其他查詢,而不是「AND的channelID = 8 「(0.3秒而不是0.0019) 爲什麼!=慢於=? – grundig