Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SQL Query Performance

Author  Topic 

cosmo74
Starting Member

1 Post

Posted - 2005-09-06 : 10:42:08
Performance around EXISTS - is there any difference, in terms of overhead, between:

EXISTS (Select 1..)

and

EXISTS (Select *)
??

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-06 : 10:44:37
I think there is no significant difference
Set the Execution Plan and test it

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

nathans
Aged Yak Warrior

938 Posts

Posted - 2005-09-06 : 10:49:27
Probably nothing between * vs 1.
The performance you gain by using EXISTS:

[url]http://www.sqlteam.com/item.asp?ItemID=14820[/url]




Nathan Skerl
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-06 : 11:27:37
Hi cosmo74, Welcome to SQL Team!

I believe that the more common convention is

EXISTS (Select *)

It supposedly allows SQL Server to choose which column, and therefore which index etc., it will use to give best performance. but I think in practice SELECT 1 will probably do the same thing.

Kristen
Go to Top of Page
   

- Advertisement -