Disclaimer: I’m not a DBA. I have picked up a few things from this board in the past that I’m building from.
I have a table of google analytics session start times. I have an index on each column. I want to filter for all sessions that were started between two dates. Screenshot below shows the query, and the index.
The query runs quickly but I do not believe it’s using the index based on the Execution plan which both says that there’s a missing index and shows a table scan rather than an index scan:
Is it because of something about the way I’m searching through the datetime? If instead of looking between dates, I set it equal to a date, the execution plan shows it using the index:
But it’s not just this table or datetime. Here’s a different table with an index on a varchar column:
And a simple query on this one also tells me I’m missing the index: