When the performance of Distinct and Group By are different?

后端 未结 2 1416
谎友^
谎友^ 2020-12-09 03:21

I know in simple queries the performance and execution plans of the Distinct and Group By are almost the same.

e.g.

SELECT Name FROM NamesTable GROUP         


        
2条回答
  •  猫巷女王i
    2020-12-09 04:10

    Here are 2 examples, one for producing a different result and the other for a different performance:

    Example for producing different performance

    And the second example:

    Example for producing different result

提交回复
热议问题