Sample Header Ad - 728x90

How does different forms of EXISTS() affect performance in MS Sql Server?

0 votes
1 answer
889 views
I've been told that when checking for the existence of a row in a table, this will work: EXISTS(SELECT 1 FROM....) but that a "better" way in regards to speed performance of the query would be to use this: EXISTS(SELECT TOP(1) NULL FROM......) I've searched online for anything that references this comparison and the only information I can find says that this is a personal preference and there actually is no performance gain of one over the other. There's always the "case by case" aspect of a question like this, but in general, is there any performance gain from using the second implementation of EXISTS() over the first one?
Asked by Gharbad The Weak (119 rep)
Mar 7, 2024, 06:20 PM
Last activity: Jun 5, 2025, 11:09 AM