I've quietly resolved performance issues by re-writing slow queries to avoid DISTINCT. Often, the DISTINCT is there only to serve as a "join-fixer," and I
Distinct is really only meant to be used like count(distinct x). If you have dupes in your output then you didn’t understand the cardinality of the data. He claims that his method is faster that just grouping by the account in the orders table. If that’s the case then SQL server is terrible.
Distinct is really only meant to be used like count(distinct x). If you have dupes in your output then you didn’t understand the cardinality of the data. He claims that his method is faster that just grouping by the account in the orders table. If that’s the case then SQL server is terrible.