self join

  • Are self joins a performance hit. Is it better to break a self join query out using temp tables. If so, how can this be explained from an execution plan.

  • It really depends. There's nothing that says a self-join is inherently bad and with proper indexing I would assume better performance than moving the data out into temporary tables and then joining against them. However, again, depending on the structure of the queries, the amount of data being returned, other factors I'm not thinking of at the moment, the temporary table solution could work better.

    Do you have a specific performance problem you're trying to solve? Can you post an execution plan? Also possibly a structure, the query & some sample data?

    "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 2 posts - 1 through 1 (of 1 total)

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