【发布时间】:2013-12-13 07:32:40
【问题描述】:
我正在使用 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 秒
有什么办法可以优化吗?
【问题讨论】:
标签: php mysql database query-optimization