Timeline for INNER JOIN making COUNT(*) slow
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 14, 2012 at 7:36 | comment | added | gbn | A worked example on SO of the performance difference of COUNT vs DMVs stackoverflow.com/a/6069288/27535 | |
Aug 13, 2012 at 16:25 | vote | accept | Darthtong | ||
Aug 13, 2012 at 15:38 | comment | added | Aaron Bertrand | @MartinSmith it may, I don't know that it's always guaranteed, but in any case the join code is still unnecessarily complex. The point of my answer was more about potentially trusting the catalog views to be "close enough" but orders of magnitude more efficient. | |
Aug 13, 2012 at 15:36 | comment | added | Martin Smith | If the FK is trusted and the column doesn't allow NULLs I would have thought SQL Server will optimise the join out. | |
Aug 13, 2012 at 15:36 | history | migrated | from stackoverflow.com (revisions) | ||
Aug 13, 2012 at 15:34 | history | answered | Aaron Bertrand | CC BY-SA 3.0 |