Does Your GROUP BY Order Matter?
Sometimes when you do GROUP BY, the order of the columns does matter. For example, these two SELECT queries produce different results:
[crayon-6aae14b6454fb778254010/]
Their actual execution plans are wildly different:
They both use the index to retrieve their data, sure, but: