CROSS APPLY VERSUS INNER JOIN

  • Regarding Performance: It depends, but yes, CROSS APPLY can be used in place of an INNER JOIN in some situations to realize a performance benefit. It's only going to work in cases where you're using a table expression, meaning a table value function or a sub-query. Generally, if you know that there's a one-to-one relation between the left and right side of a join (inner or outer), CROSS APPLY or OUTER APPLY can be used. Circumstances are different (indexes, statistics, etc.) so test it for the queries you're writing, but it does work.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply