I have been given the following slow performing query which is taking a cut from 1.2 million rows to return about 51,000. It is taking about 56 seconds which is slow for a webpage.
SELECT * FROM vwPPEKBaseQuery, vwWeeklyRanges2Only WHERE OM_Available BETWEEN WeekStart AND WeekEnd
Can I write the JOIN in a different way to speed things up or should I be looking at indexes and so on for the tables? Also I am surprised that sort of join still exists and still runs on SQL Server!