Finding Distinct Values Quickly
SQL Performance
MARCH 17, 2020
Back in 2014, I wrote an article called Performance Tuning the Whole Query Plan. This is very efficient, as confirmed by the elapsed time of 13ms (all of which is CPU time). The structure of a b-tree index makes finding the next highest value very efficient — there is no need to scan through the duplicates. Test Environment.
Let's personalize your content