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
1 view
0
0
4 months ago 02:00:45 1
Chant of the Mystics: Divine Gregorian Chant “Kyrie eleison (orbis factor)“ - 2 Hours
4 months ago 00:03:50 1
Common, Pete Rock - Wise Up (Official Music Video)
4 months ago 00:34:10 1
Замуж за темнокожего парня в 40 || Предложение на первом свидании || Отношения с иностранцем
4 months ago 00:09:25 1
➜ Do This Every Evening to TRANSFORM Your Body
4 months ago 00:36:15 1
Yasmine Naghdi ~ The Royal Ballet
4 months ago 00:01:00 1
What is the gravity on the Moon, the Sun, Mars, and other planets in the solar system? #gravity
4 months ago 00:31:37 1
Russia Vows TOTAL DESTRUCTION of Ukraine and NATO is Very Afraid of Crocus Aftermath
4 months ago 00:00:57 3
Quests from the Infinite Staircase | Official Trailer | D&D Beyond
4 months ago 00:00:47 1
Destined with You | Official Trailer | Netflix [ENG SUB]
4 months ago 00:33:58 1
Senua’s Saga: Hellblade 2 - DF Tech Review - The Next Level in Real-Time Visuals
4 months ago 00:17:14 1
СЛАБЫЕ НА ПЕРЕДОК девушки: Обводят мужчин вокруг пальца Используя 3 провокации БЕЗОШИБОЧНЫЙ ПРИЗНАК
4 months ago 00:08:07 1
angela giarratana one-liners
4 months ago 00:06:05 1
What If All The Rats Disappeared? | World Without RATS | The Dr Binocs Show | Peekaboo Kidz
4 months ago 00:05:20 1
Black Sun - Drown in Sin (Official Music Video)
4 months ago 11:55:00 1
Trump’s US Presidential Election 2024 Speech | Trump’s Michigan Rally LIVE | Trump’s Speech | N18L