sql - TSQL IN Operator over EXISTS, is there a difference? -



sql - TSQL IN Operator over EXISTS, is there a difference? -

following 2 queries produce same execution plan on sql server 2008 r2.

but sense sec query should perform better.

why see same query execution plan these two?

declare @user_id int; set @user_id = 13; if @user_id in (select [user_id] dbo.[user] home_customization not null) begin print('user has home customization...'); end else begin print('user has no home customization...'); end; if exists (select [user_id] dbo.[user] [user_id] = @user_id , home_customization not null) begin print('user has home customization...'); end else begin print('user has no home customization...'); end

sql tsql sql-server-2008-r2 query-performance query-execution-plans

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -