Timeline for T-SQL Optimizing a Join on TOP Value from another table
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 6, 2014 at 3:56 | comment | added | Nabil Becker | Um, I'm not sure of a formal name, I would look up the OVER clause if you want to research. As for what's going on behind the scenes, the "row_number()" function is adding the actual row number to the resultset. By filtering that to "1", your grabbing row number 1. This is quicker because its set based, as opposed to the scalar query in your select statement, which is going to execute for each row that is returned in the outer query. That is going to hit heavy on your IO. Hope that makes sense | |
Feb 5, 2014 at 16:17 | comment | added | John | Is there a formal name for what this type of query is called? I'd like to read more about what's actually going on behind the scenes. | |
Feb 3, 2014 at 15:47 | vote | accept | John | ||
Jan 31, 2014 at 16:32 | history | edited | ypercubeᵀᴹ | CC BY-SA 3.0 |
added 146 characters in body
|
Jan 31, 2014 at 16:22 | history | answered | Nabil Becker | CC BY-SA 3.0 |