The techie in me RSS 2.0
 Wednesday, February 20, 2008

Semi Join in SQL server

 

 

It’s an interesting fact that we never tend to use semi joins in SQL server, and instead we tend to use the more easy (or rather lazy) way of using an ‘IN’, which obviously takes huge amount of time (again depends !). I was writing a query to search from multiple tables (having millions of records) and don’t have much option of change, and it was taking lot of time (again depends!) to fetch the result set. That’s when I remembered about semi-join, replaced all lazy ‘IN’s with semi joins and I got alteast 40% performance improvement.

 

Now how to use semi joins

 

Semi Join

 

DELETE @AvalableOrgIdList FROM @AvalableOrgIdList AVL

                                    WHERE EXISTS (SELECT  OrgId FROM @TmpSrchResult RSLT WHERE RSLT.OrgId = AVL.OrgId)

 

Anti Semi join

DELETE @AvalableOrgIdList FROM @AvalableOrgIdList AVL

                                    WHERE NOT EXISTS (SELECT  OrgId FROM @TmpSrchResult RSLT WHERE RSLT.OrgId = AVL.OrgId)

 

 

Want more explanation and more in depth into SQL joins etc , check this blog.

http://blogs.msdn.com/craigfr/Default.aspx

-Rujith

Wednesday, February 20, 2008 9:30:43 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Sunday, February 17, 2008

After long days of being lazy, I finally managed to bring my blog up and running... This has been kind of dreem project for me, which was running for past few years now... :(, yes I am bit ashamed of myself. And I know this is not the way to put your first blog on ur new blog site, but thats the TRUTH...

 

Watch out for more stuffs in the space soon.......

 

-Rujith

Sunday, February 17, 2008 9:02:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Tuesday, June 27, 2006

Starting .msc files from .net application.

When writing code, lot of times we have come across situation where we want to start event viewer or any other application which uses management console . The code below shows how to start event viewer from .net application. This can be used to start services.msc or any other similar files.

Process traceFileViewerProcess = new Process(); 

string executable = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\eventvwr.msc"); 

traceFileViewerProcess.StartInfo.FileName = executable; 
 

traceFileViewerProcess.StartInfo.Arguments = "/s"; 

traceFileViewerProcess.Start(); 
Tuesday, June 27, 2006 12:20:39 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Wednesday, January 18, 2006
Converting your pretty good old test cases from Nunit to VS test cases is not as simple as posted in many blogs.
I tried to convert my test cases its really pain guys..
Its not jut renaming the name spaces and setting the alias. The Assert class itself is different. Microsoft Assert class is directly opposite to the Nunit assert classes.
 
For namespace and alias changes the following code is enough.
 
using Microsoft.VisualStudio.TestTools.UnitTesting; 

using TestFixture = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute; 

using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; 

using SetUp = Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute; 

using TearDown = Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute ; 

using TestFixtureSetUp = Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute; 

using TestFixtureTearDown = Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupAttribute; 
Wednesday, January 18, 2006 1:22:51 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
VSTS
About me
Name : Rujith Anand Send mail to the author(s)
Archive
<February 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
2425262728291
2345678
Blogs I read
Disclaimer

Disclaimer
Postings are provided as is with no warranties, and confer no rights. Opinions expressed here are my own delusions; my employers at best shake their heads and sigh, at worst repudiate the content with extreme prejudice, whenever it manages to appear on their radar.

© Copyright 2012
Rujith Anand

Statistics
Advertisement
All Content © 2012, Rujith Anand