What to choose for performance SubQuery or Joins Part 62
C#, SQL Server, WCF, MVC and ASP .NET video tutorials for beginners
What to choose for performance - SubQuery or Joins - Part 62
Link for text version of this video:
According to MSDN, in sql server, in most cases, there is usually no performance difference between queries that uses sub-queries and equivalent queries using joins. For example, on my machine I have
400,000 records in tblProducts table
600,000 records in tblProductSales tables
The following query, returns, the list of products that we have sold atleast once. This query is formed using sub-queries. When I execute this query I get 306,199 rows in 6 seconds
Select Id, Name, Description
from tblProducts
where ID IN
(
Select ProductId from tblProductSales
)
At this stage please clean the query and execution plan cache using the following T-SQL command.
CHECKPOINT;
GO
DBCC DROPCLEANBUFFERS;
Go
DBCC FREEPROCC
0 views
0
0
5 days ago 00:01:53 0
LEGO Harry Potter Collection Trailer - Switch & XBOX One
6 days ago 00:38:58 0
БУДУЩИЙ СУПРУГ 🌹Потрясающий мужчина 😍🎁🫅
6 days ago 00:52:27 0
Awakened Christ Consciousness: The Hidden Message of Jesus Revealed
6 days ago 00:22:04 4
Can Ukraine Survive Russia’s Summer Offensive?
6 days ago 00:02:14 9
The Cat in the Hat | Official Trailer
7 days ago 00:09:32 3
Muay Thai Boran Styles (New Video in Description)
1 week ago 00:04:24 1
CryptoPromo – The Leading Crypto Marketing Platform in 2025?
1 week ago 00:12:47 2
Mushoku Tensei: Blood Pact |12 Minutes Turning Point 4 Fan Animation
1 week ago 00:03:30 0
This $900 Light Bucket Sees Galaxies?! | Sky-Watcher 10“ Dobsonian Telescope Review (S11620) - YouTube
1 week ago 00:03:15 0
The Wallet Gesture and Invitation by Pastor Lance Edminster 2025 06-29
2 weeks ago 00:00:23 1
The Human Zoo They Don’t Teach You About
2 weeks ago 00:01:07 7
Cyclist Meets Family of Skunks
2 weeks ago 00:02:11 0
Albert Wesker - Back From The Dead
2 weeks ago 00:03:41 7
Alex Warren & ROSÉ - On My Mind (Official Music Video)
2 weeks ago 00:12:56 0
Google’s AI Found a Glitch in Reality — And It’s Getting Worse
2 weeks ago 00:03:02 0
CryptoPromo – How to Market a Crypto Project in 2025 (Step-by-Step Guide)
2 weeks ago 00:06:10 1
Leonard Cohen - Dance Me to the End of Love (Official Video)
2 weeks ago 00:07:36 1
P Diddy Darts Eyes at Federal Prosecutor as She Rips Him in Closings