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
Post a Comment