September 16, 2020 at 12:33 am
Great article, thank you!
I think this sentence has a typo: "Now we have a Seek Predicate on DateAdded and a Predicate filter on DelFlag with a much-improved query cost (and less logical reads)." -- looks like "DelFalg" should be "Gender" instead
September 16, 2020 at 3:07 am
Great catch! And that was with 4 other sets of eyes reviewing the article before I submitted it.
Mike Byrd
September 16, 2020 at 8:44 pm
Comments posted to this topic are about the item Indexes: When Column Selectivity Is Not Always A Requirement
Mike Byrd
September 27, 2020 at 8:18 pm
I think this shows why indexes should lead with the equality columns, then inequality columns. I used to be in that camp; order the index columns by selectivity. Now I avoid date fields for leading columns of indexes even if they're very selective.
September 27, 2020 at 9:08 pm
I would rephrase your first sentence to ..."why indexes should lead with equality columns and then range searches." Inequality columns (from your query) will almost always cause a scan rather than a seek.
Mike Byrd
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply