我尝试使用多个从表中查询ORDER BY
SELECT TOP 50
TBL_ContentsPage.NewsId,
TBL_ContentsPage.author,
TBL_ContentsPage.Header,
TBL_ContentsPage.TextContent,
TBL_ContentsPage.PostedDate,
TBL_ContentsPage.status,
TBLTempSettings.templateID
FROM TBL_ContentsPage
INNER JOIN TBLTempSettings
ON TBL_ContentsPage.NewsId = TBLTempSettings.newsId
WHERE TBL_ContentsPage.mode = '1' AND TBLTempSettings.mode = '1' AND (TBLTempSettings.templateID = @templateID OR @templateID = 'all')
ORDER BY 0 + TBLTempSettings.rank DESC
但是当我添加TBL_ContentsPage.PostedDate DESC
查询需要两倍以上的时间。TBLTempSettings.rank
已经被索引。