I an somewhat new to SQL and I have (hopefully) an easy question.
This query takes about 7 minutes to run on our DB, 10s of millions of rows.
SELECT TOP 100 collectView.tagName, collectView.time, collectView.value
FROM TIMELINE.dbo.collectView collectView`
WHERE
(collectView.tagName='currentGS.volume' and
collectView.time>getdate()-1)
ORDER BY collectView.time DESC
I was hoping that the TOP 100 in select would speed it up since it only needs 100 rows but no.
Anyone have any suggestions?